
<template>
    <div style="height: 100%; width: 100%; position: relative">
        <div :class="!is_showselother ? 'pagetop' : 'pagetopother'">
            <div style="width: 100%; overflow: auto">
                <div style="float: left; width: 100%">
                    <table style="font-size: 12px; width: 97%" class="table1style" border="0">
                        <col style="width: 4%" />
                        <col style="width: 10%" />
                        <col style="width: 1%" />
                        <col style="width: 10%" />
                        <col style="width: 3%" />
                        <col style="width: 10%" />
                        <col style="width: 4%" />
                        <col style="width: 10%" />
                        <col style="width: 4%" />
                        <col style="width: 10%" />
                        <col style="width: 4%" />
                        <col style="width: 10%" />
                        <col style="width: 4%" />
                        <col style="width: 10%" />
                        <col style="width: 6%" />
                        <col style="width: 4%" />
                        <tr>
                            <td align="right">创建日期</td>
                            <td>
                                <el-date-picker v-model="searchObj.txtdatetime1" type="date" value-format="yyyy-MM-dd" size="mini" placeholder="开始日期" :clearable="false" style="width: 100%"></el-date-picker>
                            </td>
                            <td>至</td>
                            <td>
                                <el-date-picker v-model="searchObj.txtdatetime2" type="date" value-format="yyyy-MM-dd" size="mini" placeholder="结束日期" :clearable="false" style="width: 100%"></el-date-picker>
                            </td>
                            <td align="right">条码号</td>
                            <td>
                                <el-input v-model="searchObj.txtbarcode" size="mini" clearable></el-input>
                            </td>
                            <td align="right">申请状态</td>
                            <td>
                                <rm-ddl-common datatype="seccode" kindno="req_stat" dataname="状态" v-model="searchObj.txtreqstat" width="100%" @change="req_statChange"></rm-ddl-common>
                            </td>
                            <td align="right">申请科室</td>
                            <td>
                                <rm-ddl-common datatype="dept" dataname="科室" v-model="searchObj.txtreqdeptno" size="mini" width="100%" @change="deptChange"></rm-ddl-common>
                            </td>
                            <td align="right">送检医院</td>
                            <td>
                                <rm-ddl-common datatype="hospital" dataname="医院" v-model="searchObj.txthospcode" size="mini" width="100%" @change="hospitalChange"></rm-ddl-common>
                            </td>
                            <td align="right" v-show="applyentryneedapproval == '1'">审核状态</td>
                            <td>
                                <div v-show="applyentryneedapproval == '1'">
                                    <el-select placeholder="请选择" clearable @change="changeIsApplyentry()" style="width: 100%;" v-model="searchObj.approvalstate">
                                        <el-option key="all" label="全部" value="all"></el-option>
                                        <el-option key="0" label="未审核" value="0"></el-option>
                                        <el-option key="1" label="已审核" value="1"></el-option>
                                        <el-option key="2" label="未通过" value="2"></el-option>
                                    </el-select>
                                </div>
                            </td>
                            <td align="left">
                                <span :underline="false" @click="btn_showselother">{{ is_showselother ? "收起其它条件" : "展开其它条件" }}<i :class="is_showselother ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"></i></span>
                            </td>
                        </tr>
                        <tr v-if="is_showselother">
                            <td align="right">申请项目</td>
                            <td colspan="3">
                                <rm-ddl-common datatype="reqitem" dataname="申请项目" v-model="searchObj.txtreqitem" size="mini" width="100%" :readonly="true" :clearable="true" @change="reqitemChange"></rm-ddl-common>
                            </td>
                            <td align="right">病历号</td>
                            <td>
                                <el-input v-model="searchObj.txtpatno" size="mini" style="width: 100%" clearable></el-input>
                            </td>
                            <td align="right">病人姓名</td>
                            <td>
                                <el-input v-model="searchObj.txtpatname" size="mini" style="width: 100%" clearable></el-input>
                            </td>
                            <td align="right">身份证号</td>
                            <td>
                                <el-input v-model="searchObj.txtpatidcard" size="mini" style="width: 100%" clearable></el-input>
                            </td>
                            <td align="right">病人类型</td>
                            <td>
                                <rm-ddl-common datatype="seccode" kindno="PT" dataname="病用户类型" v-model="searchObj.txtpattype" width="100%" @change="PTChange"></rm-ddl-common>
                            </td>
                            <td align="right">创建用户</td>
                            <td>
                                <rm-ddl-common datatype="userinfo" dataname="用户" v-model="searchObj.txtcreateuser" width="100%" @change="userinfoChange"></rm-ddl-common>
                            </td>
                            <td>
                                <el-button v-show="reqLocalseting.reqreadidcardseting=='1'" @click="readcard(2)">读取身份证(F4)</el-button>
                            </td>
                            <td>
                                <el-popover width="100%" trigger="click" placement="bottom">
                                    <div style="height: 200px">
                                        <table class="table1style">
                                            <tr>
                                                <td>
                                                    <el-checkbox v-model="ChkAutoAssignLabelQty" true-label="1" false-label="0" :disabled="true">自动分配标签份数</el-checkbox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <el-checkbox v-model="ChkReqitemAutoemory" true-label="1" false-label="0" :disabled="true">申请项目自动记忆</el-checkbox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <el-checkbox v-model="ChkNoShowReqBarcode" true-label="1" false-label="0" :disabled="true">不显示REQ开头的条码</el-checkbox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <el-checkbox v-model="ChkNoShowPatnoThenCreateBarcode" true-label="1" false-label="0" :disabled="true">不显示输入病历号后选取项目生成的条码</el-checkbox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <el-checkbox v-model="ChkSupportMutiplePrint" true-label="1" false-label="0" :disabled="true">支持多选打印</el-checkbox>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <el-button slot="reference" style="border: 0; color: #66b1ff; background-color: #ffffff; font-weight: bold">其余选项</el-button>
                                </el-popover>
                            </td>
                        </tr>
                    </table>
                </div>
                <div style="width: 100%; text-align: right">
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <el-button icon="el-icon-search" @click="queryData" type="primary" :disabled="changeflag">查询</el-button>
                                <el-button icon="el-icon-plus" @click="btnAdd(1)" :disabled="changeflag">新增</el-button>
                                <el-button icon="el-icon-delete" @click="btnDelete()" v-has="'PDELETE'" :disabled="changeflag">删除</el-button>
                                <el-button icon="el-icon-document" @click="btnSave()" :disabled="!changeflag">保存(F6)</el-button>
                                <el-button icon="el-icon-close" @click="btnCancel()" :disabled="!changeflag">取消</el-button>
                                <el-button icon="el-icon-camera" @click="btn_photo()" :disabled="changeflag">拍照</el-button>
                                <el-button icon="el-icon-printer" @click="btnPrint()" :disabled="changeflag || searchObj.isapproval == '1'">打印</el-button>
                                <el-button icon="el-icon-printer" @click="btnPrintCo()" :disabled="changeflag || searchObj.isapproval == '1'">打印回单</el-button>
                                <el-button icon="el-icon-document-copy" @click="btnBatchCopy()" :disabled="changeflag">批量复制</el-button>
                                <el-button icon="el-icon-document-copy" @click="btnCopy()">复制</el-button>
                                <el-button icon="el-icon-tickets" @click="btnPaste()">粘贴</el-button>
                                <el-button icon="el-icon-setting" @click="btnSet()">字段设置</el-button>
                                <el-button icon="el-icon-s-grid" @click="btnSaveDefault()">存为默认</el-button>
                                <!-- <el-button icon="el-icon-s-order" @click="btnGroup()">套餐</el-button> -->
                                <el-button icon="el-icon-upload2" @click="applyImport">申请导入</el-button>
                                <el-button icon="el-icon-upload2" @click="exportExcel">导出</el-button>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <div :class="!is_showselother ? 'pagecenter' : 'pagecenterother'">
            <div v-show="searchObj.isapproval =='1'" class="middle-center table-bottom-content">
                <vxe-table :data.sync="master" :loading="loading" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell', checkAll: true, reserve: true }" @current-change="currentChangeEvent" border show-header-overflow :height="!is_showselother ? 'auto' : '100%'" highlight-current-row highlight-hover-column :row-class-name="RowClassName" ref="lxTableTemp" resizable show-overflow @cell-dblclick="dblclickTemp" size="mini" stripe>
                    <vxe-table-column type="selection" width="45" header-align="center" align="center" v-if="ChkSupportMutiplePrint == '1'"></vxe-table-column>
                    <vxe-table-column field="isPhoto" title="图片" width="35" align="center" header-align="center">
                        <template v-slot="{ row }">
                            <div v-show = "row.isPhoto != '0'">
                                {{ row.isPhoto }}<i class="el-icon-picture" style="padding: 2px !important"></i>
                            </div>
                        </template>
                    </vxe-table-column>
                    <vxe-table-column field="last_auditmind" title="审核状态" width="60" header-align="center">
                        <template v-slot="{ row }">
                            <span v-if="row.approveflag == '0'" style="text-align: center; color: #0000C6;">未审核</span>
                            <span v-else-if="row.approveflag == '1'" style="text-align: center; color: #009100;">已审核</span>
                            <span v-else style="text-align: center; color: #CE0000;">未通过</span>
                        </template>
                    </vxe-table-column>
                    <vxe-table-column field="last_auditmind" title="审核意见" width="200" header-align="center"></vxe-table-column>
                    <vxe-table-column field="hospname" title="送检医院" width="123" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_typename" title="来源" width="50" header-align="center"></vxe-table-column>
                    <vxe-table-column field="create_dt" title="登记时间" width="130" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="pat_name" title="姓名" width="66" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_no" title="病历号" width="90" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_groupna" title="分单类别" width="88" header-align="center"> </vxe-table-column>
                    <vxe-table-column field="barcode" title="条码号" width="117" header-align="center"></vxe-table-column>
                    <vxe-table-column field="emer_flag" title="加急" width="50" header-align="center">
                        <template v-slot="{ row }">
                            <span style="color: red">{{ row.emer_flag == "1" ? "急" : "" }}</span>
                        </template>
                    </vxe-table-column>
                    <vxe-table-column field="sample_items" title="申请项目(简称，部分)" width="203" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_deptname" title="申请科室" width="94" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_docname" title="申请医生" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_bedno" title="床号" width="74" header-align="center"></vxe-table-column>
                    <vxe-table-column field="specimen_name" title="标本类型" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_sexname" title="性别" width="50" header-align="center" align="center"></vxe-table-column>
                    <vxe-table-column field="pat_agestr" title="年龄" width="50" header-align="center"></vxe-table-column>
                    <vxe-table-column field="create_username" title="创建用户" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="sampled_dt" title="采样时间 " width="130" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="sampled_username" title="采样用户" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_dt" title="申请日期 " width="130" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="pat_diag" title="临床诊断 " width="110" header-align="center"></vxe-table-column>
                    <vxe-table-column field="amount" title="应收金额 " width="80" header-align="center" align="right"></vxe-table-column>
                    <vxe-table-column field="charge_flag" title="计价标志 " width="73" header-align="center"></vxe-table-column>
                    <vxe-table-column field="saleman" title="销售员 " width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_cardno" title="就诊卡号 " width="100" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_comm" title="医生备注 " width="127" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_idcardno" title="身份证号 " width="150" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_birth" title="生日 " width="90" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd']"></vxe-table-column>
                    <vxe-table-column field="pat_address" title="地址" width="155" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_phone" title="联系电话" width="124" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_wardname" title="所属病区 " width="105" header-align="center"></vxe-table-column>
                    <vxe-table-column field="specimen_code" title="标本类型代码 " width="100" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_groupid" title="分单类别ID" width="80" header-align="center"></vxe-table-column>
                    <template v-slot:fix>
                        <div style="font-size: 17px; padding-top: 3px; background-color: #fff; text-align: center; font-weight: bold">
                            <span style="color: red; margin-left: 10px">数量: {{ datacnt }}</span
                            ><span style="color: blue; margin-left: 35px">金额: ￥{{ amountsum }}</span>
                        </div>
                    </template>
                </vxe-table>
            </div>
            <div v-show="searchObj.isapproval !='1'" class="middle-center table-bottom-content">
                <vxe-table :data.sync="master" :loading="loading" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell', checkAll: true, reserve: true }" @current-change="currentChangeEvent" border show-header-overflow :height="!is_showselother ? 'auto' : '100%'" highlight-current-row highlight-hover-column :row-class-name="RowClassName" ref="lxTable" resizable show-overflow @cell-dblclick="dblclickLXTable" size="mini" stripe>
                    <vxe-table-column type="selection" width="45" header-align="center" align="center" v-if="ChkSupportMutiplePrint == '1'"></vxe-table-column>
                    <vxe-table-column field="isPhoto" title="图片" width="35" align="center" header-align="center">
                        <template v-slot="{ row }">
                            <div v-show = "row.isPhoto != '0'">
                                {{ row.isPhoto }}<i class="el-icon-picture" style="padding: 2px !important"></i>
                            </div>
                        </template>
                    </vxe-table-column>
                    <vxe-table-column field="hospname" title="送检医院" width="123" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_typename" title="来源" width="50" header-align="center"></vxe-table-column>
                    <vxe-table-column field="create_dt" title="登记时间" width="130" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="pat_name" title="姓名" width="66" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_no" title="病历号" width="90" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_groupna" title="分单类别" width="88" header-align="center"> </vxe-table-column>
                    <vxe-table-column field="barcode" title="条码号" width="117" header-align="center"></vxe-table-column>
                    <vxe-table-column field="emer_flag" title="加急" width="50" header-align="center">
                        <template v-slot="{ row }">
                            <span style="color: red">{{ row.emer_flag == "1" ? "急" : "" }}</span>
                        </template>
                    </vxe-table-column>
                    <vxe-table-column field="sample_items" title="申请项目(简称，部分)" width="203" header-align="center"></vxe-table-column>
                    <vxe-table-column field="base_amount" title="应收金额" width="75" header-align="center" align="right"></vxe-table-column>
                    <vxe-table-column field="req_statname" title="申请状态" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="labadd" title="实验室增加标志" width="75" header-align="center" align="center">
                        <template v-slot="{ row }">
                            <el-checkbox v-model="row.labadd" true-label="1" false-label="0" disabled></el-checkbox>
                        </template>
                    </vxe-table-column>
                    <vxe-table-column field="req_deptname" title="申请科室" width="94" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_docname" title="申请医生" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_bedno" title="床号" width="74" header-align="center"></vxe-table-column>
                    <vxe-table-column field="specimen_name" title="标本类型" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_sexname" title="性别" width="50" header-align="center" align="center"></vxe-table-column>
                    <vxe-table-column field="pat_agestr" title="年龄" width="50" header-align="center"></vxe-table-column>
                    <vxe-table-column field="create_username" title="创建用户" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="print_dt" title="打印/执行时间 " width="130" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="print_username" title="打印/执行用户 " width="101" header-align="center"></vxe-table-column>
                    <vxe-table-column field="print_count" title="打印次数 " width="78" header-align="center" align="center"></vxe-table-column>
                    <vxe-table-column field="sampled_dt" title="采样时间 " width="130" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="sampled_username" title="采样用户" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_dt" title="申请日期 " width="130" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="prereport_dt" title="预出报告时间 " width="108" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd']"></vxe-table-column>
                    <vxe-table-column field="pat_diag" title="临床诊断 " width="110" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_id" title="病用户ID号 " width="87" header-align="center"></vxe-table-column>
                    <vxe-table-column field="inp_date" title="入院日期 " width="123" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="recieve_dt" title="接收时间 " width="126" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="recieve_username" title="接收用户 " width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="charge_dt" title="计价时间 " width="130" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="charge_username" title="计价用户 " width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="amount" title="实收金额 " width="80" header-align="center" align="right"></vxe-table-column>
                    <vxe-table-column field="charge_flag" title="计价标志 " width="73" header-align="center"></vxe-table-column>
                    <vxe-table-column field="test_dt" title="上机时间 " width="100" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="test_username" title="上机用户 " width="90" header-align="center"></vxe-table-column>
                    <vxe-table-column field="report_dt" title="报告时间 " width="134" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="report_username" title="检验医生姓名 " width="102" header-align="center"></vxe-table-column>
                    <vxe-table-column field="rechk_username" title="核对医生姓名 " width="95" header-align="center"></vxe-table-column>
                    <vxe-table-column field="alter_flag" title="报警 " width="52" header-align="center"></vxe-table-column>
                    <vxe-table-column field="saleman" title="销售员 " width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_cardno" title="就诊卡号 " width="100" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_comm" title="医生备注 " width="127" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_idcardno" title="身份证号 " width="150" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_birth" title="生日 " width="90" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd']"></vxe-table-column>
                    <vxe-table-column field="pat_ageyear" title="年龄岁数 " width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="inp_id" title="住院标识/就诊号" width="106" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_diag_icd" title="诊断的ICD10编码 " width="121" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_address" title="地址" width="155" header-align="center"></vxe-table-column>
                    <vxe-table-column field="pat_phone" title="联系电话" width="124" header-align="center"></vxe-table-column>
                    <vxe-table-column field="charge_typename" title="收费类型" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_wardname" title="所属病区 " width="105" header-align="center"></vxe-table-column>
                    <vxe-table-column field="cancel_dt" title="作废时间 " width="130" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="cancel_username" title="作废用户 " width="105" header-align="center"></vxe-table-column>
                    <vxe-table-column field="reject_dt" title="踢回时间 " width="130" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd HH:mm:ss']"></vxe-table-column>
                    <vxe-table-column field="reject_username" title="踢回用户 " width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="reject_reason" title="踢回原因 " width="95" header-align="center" align="center"></vxe-table-column>
                    <vxe-table-column field="reject_count" title="踢回次数 " width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="specimen_code" title="标本类型代码 " width="100" header-align="center"></vxe-table-column>
                    <vxe-table-column field="sample_detail" title="标本备注说明 " width="121" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_reason" title="送检目的 " width="107" header-align="center"></vxe-table-column>
                    <vxe-table-column field="req_groupid" title="分单类别ID" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="report_id" title="报告单ID" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="report_user" title="检验医生" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="rechk_user" title="核对医生" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="inlib_status" title="入库状态 " width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="library_id" title="所在库位ID " width="87" header-align="center"></vxe-table-column>
                    <vxe-table-column field="reqtype" title="申请单类别 " width="88" header-align="center"></vxe-table-column>
                    <vxe-table-column field="tube_color" title="试管颜色 " width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="collectbarcode" title="回单条码" width="80" header-align="center"></vxe-table-column>
                    <template v-slot:fix>
                        <div style="font-size: 17px; padding-top: 3px; background-color: #fff; text-align: center; font-weight: bold">
                            <span style="color: red; margin-left: 10px">数量: {{ datacnt }}</span
                            ><span style="color: blue; margin-left: 35px">金额: ￥{{ amountsum }}</span>
                        </div>
                    </template>
                </vxe-table>
            </div>
            <div class="middle-right">
                <div v-if="!haveUpt" class="show-area"></div>
                <rm-layout-top splitcolor="white" :splitwidth="5" :fixsize="formheight" :key="formkey">
                    <template v-slot:fix>
                        <div style="border: 1px solid #ccc; overflow: auto" class="myclass">
                            <el-form ref="masterListForm" :model="masterList" :disabled="nodata" size="mini" class="table2style">
                                <table style="width: 100%; font-size: 12px; font-weight: 500">
                                    <tr v-for="(list, index) in columnData" :key="index">
                                        <td v-for="(item, sindex) in list" :key="sindex">
                                            <table style="width: 100%; border-spacing: 0.5px" border="0">
                                                <tr>
                                                    <td style="width: 70px" align="right" :class="item.notnull == '1' ? 'must-param' : ''">{{ item.col_label }}</td>
                                                    <td style="width: 140px" v-if="item.valuetype == '2'">
                                                        <div v-if="forminfo.hasOwnProperty(item.col_code)">
                                                            <el-input v-model="masterList[forminfo[item.col_code].field.split('$')[1]]" style="width: 100%" :ref="'input' + item.seqflag" @keyup.enter.native="nextFocus(item.col_code, item.seqflag)" @input="hasChange" @dblclick.native="opendialog(item)" @keyup.space.native="SpaceEvent(item)" @keyup.up.native="InputMove('up', item.col_code, item.seqflag)" @keyup.down.native="InputMove('dn', item.col_code, item.seqflag)" @focus="InputFocus(item.col_code, item.seqflag)" @change="inputChangeEvent($event, item.col_code, item.seqflag)" :id="item.col_code"></el-input
                                                            ><!-- :disabled="item.enabled=='1'"-->
                                                        </div>
                                                        <div v-else>
                                                            <el-input v-model="masterList[item.col_code]" style="width: 100%" :ref="'input' + item.seqflag" @keyup.enter.native="nextFocus(item.col_code, item.seqflag)" @input="hasChange" @dblclick.native="opendialog(item)" @keyup.space.native="opendialog(item)" @keyup.up.native="InputMove('up', item.col_code, item.seqflag)" @keyup.down.native="InputMove('dn', item.col_code, item.seqflag)" @focus="InputFocus(item.col_code, item.seqflag)" @change="inputChangeEvent($event, item.col_code, item.seqflag)" :id="item.col_code"></el-input
                                                            ><!-- :disabled="item.enabled=='1'"-->
                                                        </div>
                                                    </td>
                                                    <td style="width: 130px" v-else-if="item.valuetype == '7'">
                                                        <el-date-picker v-model="masterList[item.col_code]" :inputable="true" :ref="'input' + item.seqflag" :clearable="false" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" style="width: 100%" @keyup.enter.native="nextFocus(item.col_code, item.seqflag)" @input="inputChangeEvent($event, item.col_code, item.seqflag)" @dblclick.native="opendialog(item)" @keyup.up.native="InputMove('up', item.seqflag)" @keyup.down.native="InputMove('dn', item.seqflag)" @focus="InputFocus(item.col_code, item.seqflag)" :id="item.col_code" v-if="item.col_code == 'pat_birth'" @change="inputChangeEvent($event, item.col_code, item.seqflag)"> </el-date-picker>
                                                        <el-date-picker v-model="masterList[item.col_code]" :inputable="true" :ref="'input' + item.seqflag" :clearable="false" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%" @keyup.enter.native="nextFocus(item.col_code, item.seqflag)" @input="hasChange" @dblclick.native="opendialog(item)" @keyup.up.native="InputMove('up', item.seqflag)" @keyup.down.native="InputMove('dn', item.seqflag)" @focus="InputFocus(item.col_code, item.seqflag)" :id="item.col_code" v-else> </el-date-picker>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr v-for="(list, index) in columnDataDisabled" :key="index * 100 + 100">
                                        <td v-for="(item, sindex) in list" :key="sindex * 1000 + 1000">
                                            <table style="width: 100%; border-spacing: 0.5px" border="0">
                                                <tr>
                                                    <td style="width: 70px" align="right">{{ item.col_label }}</td>
                                                    <td style="width: 140px" v-if="item.valuetype == '2'">
                                                        <el-input v-model="masterList[item.col_code]" style="width: 100%" :disabled="item.enabled == '0'" @change="hasChange"></el-input>
                                                    </td>
                                                    <td style="width: 130px" v-else-if="item.valuetype == '7'">
                                                        <el-date-picker v-model="masterList[item.col_code]" :clearable="false" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" style="width: 100%" :disabled="item.enabled == '0'" @change="hasChange"> </el-date-picker>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr v-for="(list, index) in columnDataChk" :key="index * 10000 + 10000">
                                        <td v-for="(item, sindex) in list" :key="sindex * 100000 + 100000">
                                            <table style="width: 100%; border-spacing: 0.5px" border="0">
                                                <tr>
                                                    <td style="width: 70px" align="right" :class="item.notnull == '1' ? 'must-param' : ''">{{ item.col_label }}</td>
                                                    <td style="width: 130px">
                                                        <el-checkbox v-model="masterList[item.col_code]" true-label="1" false-label="0" @change="hasChange"></el-checkbox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </el-form>
                        </div>
                    </template>
                    <div style="height: 100%; width: 100%">
                        <div style="padding: 5px; line-height: 25px">
                            <span style="font-size: 12px">检索录入：</span>
                            <rm-selecttable ref="reqselect" class="req-select" :currentLable="addreqitemname" :showName="showName" :tableColumnData="allReqsheetTable" :ftableDataList="fallReqsheetList" :selplaceholder="selplaceholder" :filterColumn="filterColumn" @change="selectChange"></rm-selecttable>
                            <el-button @click="btnAddDetail(2)" class="el-button--310">分类录入</el-button>
                            <el-button @click="btnAddDetail(3)" class="el-button--310">套餐录入</el-button>
                            <el-button v-show="reqLocalseting.reqreadidcardseting=='1'" :disabled="!changeflag" @click="readcard(1)" style="float: right;">读取身份证(F1)</el-button>
                        </div>
                        <div class="table-bottom-content" style="height: calc(100% - 37px)">
                            <vxe-table :data.sync="detail" :loading="right_loading" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border :height="!is_showselother ? 'auto' : '100%'" highlight-current-row highlight-hover-column ref="rxTable" resizable show-overflow size="mini" stripe :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true, showIcon: true, activeMethod: activeMethod }">
                                <vxe-table-column field="seq" title="序号 " width="40" header-align="center"></vxe-table-column>
                                <vxe-table-column field="req_itemcode" title="项目名称" width="166" header-align="center" :edit-render="{ name: 'input' }">
                                    <template v-slot:edit="{ row }">
                                        <rm-selecttable ref="tablereqselect" :currentLable="row.req_itemname" :showName="showName" :tableColumnData="allReqsheetTable" :ftableDataList="fallReqsheetList" :filterColumn="filterColumn" @change="changeReqitem($event, row)" :popperappendtobody="false"></rm-selecttable>
                                    </template>
                                    <template v-slot="{ row }">
                                        <span>{{ getShowName(row.req_itemcode, "allReqsheetList") }}</span>
                                    </template>
                                </vxe-table-column>
                                <vxe-table-column field="item_price" title="价格" width="40" header-align="center" align="right"></vxe-table-column>
                                <vxe-table-column field="specimen_code" title="标本类型" width="88" header-align="center" :edit-render="{ name: 'input' }">
                                    <template v-slot="{ row }">
                                        <rm-ddl-common :disabled="nodata" datatype="specimen" dataname="标本类型" v-model="row.specimen_code" width="100%" key="specimen_code"></rm-ddl-common>
                                    </template>
                                </vxe-table-column>
                                <vxe-table-column field="qty" title="数量" width="40" header-align="center" align="center"></vxe-table-column>
                                <vxe-table-column field="amount" title="金额" width="40" header-align="center" align="right"></vxe-table-column>
                                <vxe-table-column field="req_groupname" title="分单类别" width="80" header-align="center"></vxe-table-column>
                                <vxe-table-column field="req_itemcode" title="项目代码" width="90" header-align="center"></vxe-table-column>
                                <!-- <vxe-table-column field="req_groupid" title="分单类别ID" width="119" header-align="center"></vxe-table-column> -->
                                <template v-slot:fix>
                                    <div style="font-size: 17px; padding: 3px; background-color: #fff; text-align: center; font-weight: bold">
                                        <span style="position: absolute; left: 10px">
                                            <el-checkbox v-model="ChkSaveThenNotClearItem" true-label="1" false-label="0" @change="SaveNotClearItemChange">保存后不清空项目</el-checkbox>
                                        </span>
                                        <el-button @click="btnAddDetail" class="el-button--310">新增明细</el-button>
                                        <el-button @click="btnDeleteDetail" class="el-button--310">删除明细</el-button>
                                        <el-button v-if="dept.length > 0" @click="saveAsSheet" class="el-button--310">存为套餐</el-button>
                                        <span style="color: blue; position: absolute; right: 0">金额：￥{{ detailAmountSum }}</span>
                                    </div>
                                </template>
                            </vxe-table>
                        </div>
                    </div>
                </rm-layout-top>
            </div>
        </div>
        <!--批量复制-->
        <el-dialog width="20%" v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="批量复制" :visible.sync="batchcopyVisible">
            <div>
                <table style="width: 100%">
                    <tr>
                        <td width="100">复制数量</td>
                        <td>
                            <el-input v-model="copyCount" placeholder="请输入" @input="handleEdit" ref="copyCount"></el-input>
                        </td>
                    </tr>
                    <tr v-show="applyentryneedapproval != '1'">
                        <td width="100">是否打印回单</td>
                        <td>
                            <el-select v-model="IsPrintCole" style="width: 100%">
                                <el-option v-for="item in isPrintColeOptions" :key="item.value" :value="item.value" :label="item.label"></el-option>
                            </el-select>
                        </td>
                    </tr>
                </table>
                <div class="detail-operation">
                    <el-button class="el-button--310" @click="queryCopy()">确定</el-button>
                    <el-button class="el-button--310" @click="cancelCopy()">取消</el-button>
                </div>
            </div>
        </el-dialog>
        <!--双击弹窗-->
        <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" :title="dialogtitle" :visible.sync="dialogform">
            <rm-pop-common @change="popcomchange" @cancel="dialogform = false" :datatype="datatype" :key="dialogkey" :kindno="kindno"></rm-pop-common>
        </el-dialog>
        <!--申请项目双击弹窗-->
        <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="请选择申请项目" v-if="dialogReqItem" :visible.sync="dialogReqItem" width="930px" @closed="closeReqitem(1, 'rmreqitem')">
            <div>
                <rm-ReqItem-new ref="rmreqitem" @change="reqitemchange" @cancel="dialogReqItem = false" :showGroup="true" :multiChk="true" prono="LIS251"></rm-ReqItem-new>
            </div>
            <!-- <rm-ReqItem-new @change="reqitemchange" @cancel="dialogReqItem=false;" :showGroup="true" :multiChk="true"></rm-ReqItem-new> -->
        </el-dialog>
        <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="请选择申请项目" :visible.sync="dialogReqItem1" v-if="dialogReqItem1" width="910px">
            <rm-reqsheet prono="LIS251" @change="chooseReqsheet"></rm-reqsheet>
        </el-dialog>
        <!--设置弹窗-->
        <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="输入字段设置(申请录入)" :visible.sync="dialogSetting" width="930px">
            <div style="height: 500px">
                <rm-layout-right splitcolor="white" movingcolor="#0000ff" :splitwidth="5" :fixsize="250">
                    <template v-slot:fix>
                        <div>
                            <div style="padding-left: 10px">
                                <el-checkbox true-label="1" false-label="0" v-model="reqLocalseting.reqinputloaclseting" @change="preInputloaclseting">输入字段本地存储</el-checkbox>
                            </div>
                            <div style="padding-left: 10px">
                                <el-checkbox true-label="1" false-label="0" v-model="reqLocalseting.reqprintreceiptseting" @change="prePrintloaclseting">保存后打印回执单</el-checkbox>
                            </div>
                            <div style="padding-left: 10px">
                                <el-checkbox true-label="1" false-label="0" v-model="reqLocalseting.reqprintbarcodeseting" @change="reqPrintBarcodeSeting">存盘后立即打印条码</el-checkbox>
                            </div>
                            <div style="padding-left: 10px">
                                <el-checkbox true-label="1" false-label="0" v-model="reqLocalseting.reqreadidcardseting" @change="reqReadIDCardSeting">是否读取身份证信息</el-checkbox>
                            </div>
                            <div style="margin-top: 10px; text-align: center">
                                <el-button @click.native="dialogSettingSave">确定</el-button>
                                <el-button @click.native="dialogSettingCancel">取消</el-button>
                            </div>
                        </div>
                    </template>
                    <div style="height: 100%; width: 100%; background-color: #ddccbb">
                        <vxe-table :data.sync="settingData" :loading="settingloading" :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true, showIcon: false }" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border height="auto" highlight-current-row highlight-hover-column highlight-hover-row ref="psetTable" resizable show-overflow size="mini" stripe>
                            <vxe-table-column field="seq_no" title="序号" width="50" header-align="center" :edit-render="{ name: 'input', autoselect: true }"></vxe-table-column>
                            <vxe-table-column field="col_name" title="字段名称" width="80" header-align="center"></vxe-table-column>
                            <vxe-table-column field="col_label" title="提示文字" width="80" header-align="center" :edit-render="{ name: 'input', autoselect: true }"></vxe-table-column>
                            <vxe-table-column field="default_val" title="默认值" width="70" header-align="center" :edit-render="{ name: 'input', autoselect: true }"></vxe-table-column>
                            <vxe-table-column field="visibled" title="可见" width="40" header-align="center" align="center">
                                <template v-slot="{ row }">
                                    <el-checkbox v-model="row.visibled" true-label="1" false-label="0"></el-checkbox>
                                </template>
                            </vxe-table-column>
                            <vxe-table-column field="enabled" title="可编辑" width="50" header-align="center" align="center">
                                <template v-slot="{ row }">
                                    <el-checkbox v-model="row.enabled" true-label="1" false-label="0"></el-checkbox>
                                </template>
                            </vxe-table-column>
                            <vxe-table-column field="notnull" title="必填" width="40" header-align="center" align="center">
                                <template v-slot="{ row }">
                                    <el-checkbox v-model="row.notnull" true-label="1" false-label="0"></el-checkbox>
                                </template>
                            </vxe-table-column>
                            <vxe-table-column field="noedit" title="禁止双击" width="70" header-align="center" align="center">
                                <template v-slot="{ row }">
                                    <el-checkbox v-model="row.noedit" true-label="1" false-label="0"></el-checkbox>
                                </template>
                            </vxe-table-column>
                            <vxe-table-column field="rem_last" title="自动记忆" width="70" header-align="center" align="center">
                                <template v-slot="{ row }">
                                    <el-checkbox v-model="row.rem_last" true-label="1" false-label="0"></el-checkbox>
                                </template>
                            </vxe-table-column>
                            <vxe-table-column field="col_code" title="字体代码" width="89" header-align="center"></vxe-table-column>
                        </vxe-table>
                    </div>
                </rm-layout-right>
            </div>
        </el-dialog>

        <el-dialog width="325px" top="10px" :append-to-body="true" :close-on-click-modal="false" title="保存为套餐" :visible.sync="saveReqsheetVisible" :destroy-on-close="true" @opened="$refs.input11.select()">
            <div>
                <table style="width: 100%">
                    <tr>
                        <td width="80" align="right" class="must-param">套餐名称</td>
                        <td colspan="4">
                            <el-input v-model="reqsheetParam.sheet_name" placeholder="" ref="input11" @keyup.enter.native="$refs.input12.select()"></el-input>
                        </td>
                    </tr>
                    <tr>
                        <td width="80" align="right" class="must-param">所属科室</td>
                        <td colspan="4">
                            <el-input v-model="reqsheetParam.deptname" disabled></el-input>
                        </td>
                    </tr>
                    <tr>
                        <td width="80" align="right" style="vertical-align: top">备注说明</td>
                        <td colspan="4">
                            <el-input type="textarea" v-model="reqsheetParam.description" rows="3" ref="input12"></el-input>
                        </td>
                    </tr>
                </table>
                <div class="detail-operation">
                    <el-button class="el-button--310" @click="dealReqsheet(1)">确定</el-button>
                    <el-button class="el-button--310" @click="dealReqsheet(2)">取消</el-button>
                </div>
            </div>
        </el-dialog>
        <!-- 申请导入 -->
        <el-dialog width="auto" v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="文件导入" v-if="importDialog" :visible.sync="importDialog">
            <rm-reqimport ref="reqImport" prono="LIS251" importdest="REQ" :barcodestyle="barcodestyle" :cxbarcodeprinter="cxbarcodeprinter" @change="reqImportChange" @reqitemDialogShow="reqitemDialogShow"></rm-reqimport>
        </el-dialog>

        <!-- 拍照弹窗 -->
        <el-dialog width="500px" v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" :title="titlePhotoDlg" :visible.sync="photoDialog" @close="clearPhoto()">
            <div style="width: 490px; height: 350px;">
                <div style="width: 100%; height: 35px;" v-if="showPhotoBtn == '1'">
                    <el-button icon="el-icon-camera" type="primary" style="float:left; margin-left:10px; margin-top:3px; margin-bottom:5px;" @click="btnTakePhoto()">拍照</el-button>

                    <el-button icon="el-icon-circle-close" style="float:right; margin-right:10px; margin-top:3px; margin-bottom:5px;" @click="cancelPhoto()">取消</el-button>
                    <el-button icon="el-icon-circle-check" style="float:right; margin-left:10px; margin-top:3px; margin-bottom:5px;" @click="savePhoto()">保存</el-button>
                </div>
                <div style="width: 100%; height: 315px;">
                    <el-carousel trigger="click" style="height: 100%; width: 100%;" height="100%" :autoplay="false">
                        <el-carousel-item v-for="(item,i) in LPicData" :key="i">
                            <div style="position:relative; height: 100%; width: 100%;">
                                <el-button v-if="showPhotoBtn == '1'" style="z-index:3000; float: right; position: absolute; top: 85%; right: 8%;" type="danger" @click="deletepic(item)" icon="el-icon-delete" circle></el-button>
                                <el-image :src="item" @click="onPreview(item)" style=" width: 100%; height: 99%;"></el-image>
                            </div>
                        </el-carousel-item>
                    </el-carousel>
                </div>
                <el-image-viewer v-if="showViewer" :on-close="closeViewer" :url-list="viewerList"/>
            </div>
        </el-dialog>
        <div v-show="reqitemDialog" ref="selectDialog" class="reqitem-dialog" :style="{ top: testDialogY + 'px', left: testDialogX + 'px' }">
            <div class="reqitem-select" style="height: 250px">
                <vxe-table ref="selectTable" :data.sync="tableReqsheetList" height="auto" stripe resizable header-align="center" highlight-current-row highlight-hover-column highlight-hover-row how-header-overflow :keyboard-config="keyConfig" show-overflow size="mini" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" @current-change="selectCurrChange">
                    <vxe-table-column v-for="item in allReqsheetTable" :key="item.id" :field="item.data" :title="item.label" :width="item.width" :align="item.align" show-overflow-tooltip></vxe-table-column>
                    <!-- <vxe-table-column field="col_name" title="字段名称" width="80"></vxe-table-column> -->
                </vxe-table>
            </div>
        </div>
    </div>
</template>

<script type="text/javascript">
import reqitem from "@/components/common/reqitem";
import XEUtils from "xe-utils";
import RmSelecttable from "@/components/rmcompents/rm_selecttable.vue";
import RmReqsheet from "@/components/rmcompents/rmreq/rm_reqsheet.vue";
import RmReqimport from "@/components/rmcompents/rmreq/rm_reqimport.vue";
import ElImageViewer from '../../../../element-ui/packages/image/src/image-viewer';
export default {
    name: "LIS251",
    components: {
        RmSelecttable,
        RmReqsheet,
        RmReqimport,
        ElImageViewer,
    },
    data() {
        return {
            searchObj: {
                txtpattype: "",
                txtcreateuser: "",
                txtpatname: "",
                txtpatidcard:"",
                txtpatno: "",
                txtreqitem: "",
                txthospcode: "",
                txtreqdeptno: "",
                txtreqstat: "",
                txtbarcode: "",
                txtdatetime1: this.$pub.InitDate(),
                txtdatetime2: this.$pub.InitDate(),
                isapproval: "0",
                approvalstate:"",
            },
            txtreqstatname: "",
            txtreqdeptname: "",
            txthospname: "",
            txtreqitemname: "",
            txtpattypename: "",
            txtcreateusername: "",
            ChkSaveThenPrintLabel: "1",
            ChkAutoAssignLabelQty: "0",
            ChkReqitemAutoemory: "0",
            ChkNoShowReqBarcode: "0",
            ChkNoShowPatnoThenCreateBarcode: "0",
            ChkSupportMutiplePrint: "1",
            ChkSaveThenNotClearItem: "0", //保存后不清空项目
            loading: false,
            nodata: true,
            right_loading: false,
            detail: [],
            master: [],
            masterList: {
                pat_agestr: "",
                pat_birth: "",
            },
            actionindex: "M",
            dblclickRow: [],
            dialogkey: 0,
            changeflag: false,
            dialogform: false,
            dialogReqItem: false,
            dialogReqItem1: false,
            is_showselother: false,
            dialogSetting: false,
            settingloading: false,
            batchcopyVisible:false,
            settingData: [],
            formheight: 0,
            formkey: 0,
            columnData: [],
            columnDataDisabled: [],
            columnDataChk: [],
            popdatatype: "",
            cx_backrpt_style: "",
            backbarmode: "2",
            cx_backrrintername:"",
            dialogtitle: "",
            field: "",
            datatype: "",
            kindno: "",
            initHosp: {
                hospcode: "",
                hospname: "",
                pat_hospcode: "",
                pat_hospname: "",
            },
            barcodestyle: "",
            cxbarcodeprinter: "",
            //DDL快速输入码
            InputCodeArr: [],
            forminfo: reqitem.forminfo,
            defaultCol: reqitem.defaultCol,
            allReqsheetTable: reqitem.allReqsheetTable,
            filterColumn: reqitem.filterColumn,
            showName: reqitem.showName,
            selplaceholder: reqitem.selplaceholder,
            fhaveUpt: false,
            haveUpt: false,
            dept: "",
            saveReqsheetVisible: false,
            reqsheetParam: {},
            IsAreaMode: false,
            allReqsheetList: [],
            fallReqsheetList: [],
            allReqsheetListMap: [],
            addreqitemname: "",
            importDialog: false,
            reqitemDialog: false,
            testDialogX: 0,
            testDialogY: 0,
            tableReqsheetList: [],
            keyConfig: {
                isArrow: true,
                isEnter: true,
            },
            loginutype: this.$tool.getSession(this.$tool.loginutype),
            inputPattypeList: [],
            reqLocalseting: {
                reqinputloaclseting: 0,
                reqprintreceiptseting: 0,
                reqprintbarcodeseting: 1,
                reqreadidcardseting:0,
            },
            readcardcmdline: "",
            applyentryneedapproval: "",
            copyCount:"",
            IsPrintCole:"0",
            isCopyMode:"0",
            isPrintColeOptions: [
                {
                    value: "0",
                    label: "否",
                },
                {
                    value: "1",
                    label: "是",
                },],
            refsObj:[],
            photoDialog: false,
            showViewer: false,
            viewerList: [],
            LPicData: [],
            reqimage: "",
            currRow: [],
            showPhotoBtn: '1',
            titlePhotoDlg: "拍照",
        };
    },
    mounted() {
        this.initData(); //初始化下拉框的数据
        //this.InitPage(); //初始化主列表
        this.Queryddl();
        let modOption1 = localStorage.getItem("rm_Qmod_LIS251");
        let modjson = JSON.parse(modOption1);
        if (modjson != null) {
            this.searchObj.txtpattype = modjson.txtpattype;
            this.searchObj.txtcreateuser = modjson.txtcreateuser;
            this.searchObj.txtpatname = modjson.txtpatname;
            this.searchObj.txtpatno = modjson.txtpatno;
            this.searchObj.txtreqitem = modjson.txtreqitem;
            this.searchObj.txthospcode = modjson.txthospcode;
            this.searchObj.txtreqdeptno = modjson.txtreqdeptno;
            this.searchObj.txtreqstat = modjson.txtreqstat;
            this.searchObj.txtbarcode = modjson.txtbarcode;
            this.ChkSaveThenPrintLabel = modjson.ChkSaveThenPrintLabel;
            this.ChkAutoAssignLabelQty = modjson.ChkAutoAssignLabelQty;
            this.ChkReqitemAutoemory = modjson.ChkReqitemAutoemory;
            this.ChkNoShowReqBarcode = modjson.ChkNoShowReqBarcode;
            this.ChkNoShowPatnoThenCreateBarcode = modjson.ChkNoShowPatnoThenCreateBarcode;
            this.ChkSupportMutiplePrint = "1"; //modjson.ChkSupportMutiplePrint;
        }
        this.refsObj = this.$refs.lxTable;

        this.$bus.$on("imagecatch", (imgbase64) => {
            this.imagecatch(imgbase64);
        });
    },
    beforeDestroy() {
        this.$bus.$off("imagecatch");
    },
    destroyed() {},
    computed: {
        datacnt() {
            if(!!this.master){
                return this.master.length
            }
            else {
                return 0
            }
        },
        amountsum() {
            return XEUtils.sum(this.master, "amount");
        },
        detailAmountSum() {
            return XEUtils.sum(this.detail, "amount");
        },
        detailseq() {
            let data = this.$refs.rxTable.tableData;
            if (data.length > 0) {
                return (data.length + 1) * 10;
            } else {
                return 10;
            }
        },
    },
    methods: {
        btn_showselother() {
            this.is_showselother = !this.is_showselother;
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "showselother",
                        is_showselother: this.is_showselother?"1":"0",
                    },
                })
                .then((res) => {
                    if (res.flag == "1") {
                        //this.$pub.message(this, "保存成功", "success");
                    } else {
                        //this.$pub.message(this, "保存失败" + res.msg, "error");
                    }
                });
        },
        readcard(source) {
            if (typeof jsObj != "undefined") {
                var s = jsObj.ReadCard(this.readcardcmdline);
                if (!s) {
                    this.$message.error("读卡失败");
                } else {
                    console.log(s)
                    if (s.startsWith("JSON:")) {
                        //去掉开头字符串
                        var str=s.substring(5);
                        var strObj=JSON.parse(str);
                        if(!!strObj){
                            //赋值
                            if(source==2){
                                this.searchObj.txtpatname=strObj.name;
                                this.searchObj.txtpatidcard=strObj.idcardno;
                            }
                            else{
                                this.masterList.pat_name=strObj.name;
                                this.masterList.pat_address=strObj.address;
                                this.masterList.pat_idcardno=strObj.idcardno;
                                this.calcBirthAgeSex(strObj.idcardno);
                                this.masterList.pat_sex= strObj.sex;
                                this.masterList.pat_sexname= strObj.sex=='1'?"男":(strObj.sex=='2'?'女':strObj.sex);
                                this.masterList.pat_birth= XEUtils.toDateString(strObj.birth, "yyyy-MM-dd");
                                this.masterList.pat_cardno=strObj.cardno;
                            }
                        }
                        this.$message.success("读取成功");
                    }
                    else{
                        //返回卡号
                        if(source==2){
                            //this.searchObj.txtpatno=strObj.cardno;
                        }
                        else{
                            this.masterList.pat_cardno=s;
                        }
                    }
                }
            } else {
                this.$alert("请使用" + this.$pub.clientname + "打开系统", "错误", {
                    confirmButtonText: "确定",
                });
            }
        },
        initData() {
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "initdata",
                    },
                })
                .then((res) => {
                    this.settingData = res.columnData;
                    this.initHosp.hospcode = res.hospcode;
                    this.initHosp.hospname = res.hospname;
                    this.initHosp.pat_hospcode = res.hospcode;
                    this.initHosp.pat_hospname = res.hospname;
                    this.barcodestyle = res.barcodestyle;
                    this.cxbarcodeprinter = res.cxbarcodeprinter;
                    this.reqLocalseting.reqinputloaclseting = res.reqinputloaclseting;
                    this.reqLocalseting.reqprintreceiptseting = res.reqprintreceiptseting;
                    this.reqLocalseting.reqprintbarcodeseting = res.reqprintbarcodeseting;
                    this.reqLocalseting.reqreadidcardseting = res.reqreadidcardseting;
                    this.ChkSaveThenNotClearItem = res.savenotclearitem;
                    this.is_showselother = res.showselother=="0"? false : true;
                    //this.columnData = res.columnData;
                    this.InitColumn();
                    // this.rcvliststyleid = res.rcvliststyleid;
                    // this.reqliststyleid = res.reqliststyleid;
                    this.dept = res.dept;
                    this.fhaveUpt = res.haveUpt;
                    this.haveUpt = this.fhaveUpt;
                    this.IsAreaMode = res.IsAreaMode;
                    this.cx_backrpt_style=res.cx_backrpt_style;
                    this.backbarmode=res.backbarmode;
                    this.cx_backrrintername=res.cx_backrrintername;
                    // this.fallReqsheetList = XEUtils.clone(res.Reqitem2.data, true);
                    this.allReqsheetList = res.Reqitem2;
                    this.allReqsheetListMap = this.$pub.arrayToMap(this.allReqsheetList, "req_itemcode", "req_itemname");
                    this.readcardcmdline = res.readcardcmdline;
                    this.applyentryneedapproval = res.applyentryneedapproval;
                    this.queryReqsheet();
                })
                .catch((err) => {});
        },
        // 在 Input 值改变时触发
        handleEdit(e) {
            let value = e.replace(/^(0+)|[^\d]+/g,''); // 以0开头或者输入非数字，会被替换成空
            value = value.replace(/(\d{3})\d*/, '$1') // 最多保留3位整数
            this.copyCount = value
        },
        cancelCopy() {
            this.batchcopyVisible=false;
        },
        queryCopy() {
            if(!this.copyCount){
                return this.$pub.message(this, "复制数量不能为空", "warningerror");
            }
            var ccount=this.copyCount-0;
            if(ccount>300){
                return this.$pub.message(this, "复制数量不能超过300", "warningerror");
            }
            //复制
            this.copySave(this.copyCount);
            this.batchcopyVisible=false;
        },
        async copySave(){
            this.copyRealSave().then((res) => {
                if (res.errcode == "1") {
                    this.$pub.message(this, "复制成功！", "success");
                    if (this.reqLocalseting.reqprintbarcodeseting == "1" && this.applyentryneedapproval != '1') {
                        //打印条码
                        this.$pub.printbarcode(this, res.keyid, "1", this.barcodestyle, this.cxbarcodeprinter, "1");
                    }
                    if(this.IsPrintCole=="1" && this.applyentryneedapproval != '1'){
                        //打印回单
                        if (res.collectbarcode.indexOf(",") > -1) {
                            res.collectbarcode.split(",").forEach((item) => {
                                if (item != "") {
                                    this.$pub.printbackbar(this, item, "1", this.cx_backrpt_style, this.pbackmode, this.cx_backrrintername);
                                }
                            });
                        } else {
                            this.$pub.printbackbar(this, res.collectbarcode, "1", this.cx_backrpt_style, this.pbackmode, this.cx_backrrintername);
                        }
                    }
                    this.queryData(res.keyid);
                } else {
                    this.$pub.message(this, "复制失败！" + res.errmsg, "error");
                }
            });
        },
        async copyRealSave() {
            try {
                //设置条码号为空
                var date=this.masterList;
                if(!!date.barcode){
                    date.barcode="";
                }
                const result = await this.$tool.request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "copySave",
                        actionindex: "A",
                        copyCount:this.copyCount,
                        saveinfo: date,
                        oldinfo: this.oldmasterList,
                        urec: this.$refs.rxTable.tableData,
                        ChkSaveThenNotClearItem: this.ChkSaveThenNotClearItem,
                    },
                });
                return result;
            } catch (e) {
                this.$alert(e);
            }
        },
        Queryddl() {
            const loading = this.$loading({
                lock: true,
                text: "Loading",
                spinner: "el-icon-loading",
                background: "rgba(0, 0, 0, 0.7)",
            });
            //初始化获取所有的InputCodeArr
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "queryddl",
                    },
                })
                .then((res) => {
                    var inputCodeArr = res.inputCodeArr;
                    var sale = inputCodeArr.find((item) => item.key == "sampled_user$sampled_username");
                    if (sale) {
                        inputCodeArr.push({ key: "saleman$saleman", list: sale.list });
                    }
                    this.InputCodeArr = inputCodeArr;
                    let pattype = inputCodeArr.find((item) => item.key == "pat_typecode$pat_typename");
                    if (pattype) this.inputPattypeList = pattype.list;
                    loading.close();
                });
        },
        InitColumn() {
            //取出所有可见可編輯的数据
            let data = this.settingData.filter((item) => item.visibled == "1" && item.enabled == "1");
            //取出所有可见不可編輯的数据
            let disdata = this.settingData.filter((item) => item.visibled == "1" && item.enabled != "1");
            this.defaultCol.forEach((item) => {
                let tempdata = { col_code: item.code, col_label: item.name, col_name: item.name, default_val: "", enabled: "0", noedit: "", prg_no: "LIS251", rem_last: "0", reserved: "", seq_no: 10, valuelist: "", valuetype: item.type, visibled: "1" };
                disdata.push(tempdata);
            });
            //取出可见所有checkbox的数据
            let chkdata = [];
            let chkdata1 = data.filter((item) => item.valuetype == "1");
            data = data.filter((item) => item.valuetype != "1");
            let chkdata2 = disdata.filter((item) => item.valuetype == "1");
            disdata = disdata.filter((item) => item.valuetype != "1");
            chkdata = XEUtils.union(chkdata1, chkdata2);
            //计算行数
            let len = data.length;
            let rows = Math.ceil(len / 3);
            data.forEach((item, index) => {
                item.seqflag = index + 1;
            });
            //计算高度
            // this.formheight = 23 * (rows + Math.ceil(disdata.length / 3) + Math.ceil(chkdata.length / 3));
            this.formheight = 23 * (rows + Math.ceil(chkdata.length / 3));
            this.formkey++;
            //焦点定位赋值
            let ys = len % 3;
            let column1 = 1;
            let column2 = rows + 1;
            let column3 = len % 3 == 1 ? rows * 2 : rows * 2 + 1;
            let columnarr = [column1, column2, column3];
            let disarraycol = XEUtils.chunk(disdata, 3);
            this.columnDataDisabled = disarraycol;
            //带有checkbox在目前只有两个，暂时先这样
            let chkarraycol = XEUtils.chunk(chkdata, 3);
            this.columnDataChk = chkarraycol;

            let arraycol = XEUtils.chunk(data, 3);
            this.columnData = arraycol;
            for (let i = 0; i < arraycol.length; i++) {
                for (let j = 0; j < arraycol[i].length; j++) {
                    arraycol[i][j].seqflag = columnarr[j];
                    columnarr[j]++;
                }
            }
        },
        currentChangeEvent({ row }) {
            this.nodata = false;
            if (!this.changeflag) {
                if(this.searchObj.isapproval == '1'){
                    this.getApplicationdetails(row);
                    if(row.approveflag == '1'){
                        this.nodata = true;
                    }
                }
                else {
                    this.getdetails(row);
                    if(this.applyentryneedapproval == '1'){
                        this.nodata = true;
                    }
                }
            } else {
                this.refsObj.setCurrentRow(this.selectRow);
            }
        },
        async getdetails(row) {
            try {
                if (!!row) {
                    this.selectRow = row;
                    this.actionindex = "M";
                    const res = await this.$tool.request({
                        url: "LIS/LIS2/LIS251",
                        method: "post",
                        data: {
                            action: "getdetails",
                            barcode: row.barcode,
                        },
                    });
                    this.masterList = res.master[0];
                    this.oldmasterList = XEUtils.clone(res.master[0], true);
                    this.detail = res.detail;
                    if (res.detail.length > 0) {
                        this.$refs.rxTable.setCurrentRow(res.detail[0]);
                    } else {
                        this.$refs.rxTable.setCurrentRow(null);
                    }
                } else {
                    this.HighLightRow(false);
                }
            } catch (e) {
                this.$alert(e);
            }
        },
        async getApplicationdetails(row) {
            try {
                if (!!row) {
                    this.selectRow = row;
                    this.actionindex = "M";
                    const res = await this.$tool.request({
                        url: "LIS/LIS2/LIS251",
                        method: "post",
                        data: {
                            action: "getApplicationdetails",
                            id: row.id,
                        },
                    });
                    this.masterList = res.application[0];
                    this.oldmasterList = XEUtils.clone(res.application[0], true);
                    this.detail = res.detail;
                    if (res.detail.length > 0) {
                        this.$refs.rxTable.setCurrentRow(res.detail[0]);
                    } else {
                        this.$refs.rxTable.setCurrentRow(null);
                    }
                } else {
                    this.HighLightRow(false);
                }
            } catch (e) {
                this.$alert(e);
            }
        },
        queryData(barcode) {
            this.loading = true;
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "queryData",
                        //这些条件暂时不用
                        // ChkSaveThenPrintLabel: this.ChkSaveThenPrintLabel,
                        // ChkAutoAssignLabelQty: this.ChkAutoAssignLabelQty,
                        // ChkReqitemAutoemory: this.ChkReqitemAutoemory,
                        // ChkNoShowReqBarcode: this.ChkNoShowReqBarcode,
                        // ChkNoShowPatnoThenCreateBarcode: this.ChkNoShowReqBarcode,
                        // ChkSupportMutiplePrint: this.ChkSupportMutiplePrint,
                        ...this.searchObj,
                    },
                })
                .then((res) => {
                    this.master=[];
                    this.master = res.data;
                    this.loading = false;
                })
                .catch((err) => {
                    this.$alert(err, "提示");
                    this.loading = false;
                });
        },
        HighLightRow(row) {
            if (!!row) {
                this.refsObj.setCurrentRow(row);
                this.getdetails(row);
                if(this.applyentryneedapproval == "1" && this.searchObj.isapproval != '1'){
                    this.nodata = true;
                }
                else {
                    this.nodata = false;
                }
            } else {
                this.refsObj.setCurrentRow(null);
                this.masterList = {
                    hospcode: XEUtils.clone(this.initHosp.hospcode, true),
                    hospname: XEUtils.clone(this.initHosp.hospname, true),
                    pat_hospcode: XEUtils.clone(this.initHosp.pat_hospcode, true),
                    pat_hospname: XEUtils.clone(this.initHosp.pat_hospname, true),
                };
                this.detail = [];
                this.nodata = true;
            }
        },
        btnAdd(type) {
            this.changeflag = true;
            this.haveUpt = true;
            this.actionindex = "A";
            this.nodata = false;
            var copyMasterList = XEUtils.clone(this.masterList, true);
            this.masterList = {
                hospcode: XEUtils.clone(this.initHosp.hospcode, true),
                hospname: XEUtils.clone(this.initHosp.hospname, true),
                pat_hospcode: XEUtils.clone(this.initHosp.pat_hospcode, true),
                pat_hospname: XEUtils.clone(this.initHosp.pat_hospname, true),
                req_deptno: "",
                req_dt: "",
                pat_typecode: "",
                req_docno: "",
                original_reqno: "",
                pat_no: "",
                req_wardno: "",
                sampled_user: "",
                pat_name: "",
                req_bedno: "",
                sampled_dt: "",
                // pat_sex: "1",
                // pat_sexname: "男",
                pat_sex: "",
                pat_sexname: "",
                pat_address: "",
                perform_dept: "",
                pat_agestr: "",
                pat_birth: "",
                saleman: "",
                pat_diag: "",
                pat_phone: "",
                barcode: "",
                req_comm: "",
                specimen_code: "",
                pat_idcardno: "",
                emer_flag: "0",
                charge_flag: "0",
                pat_cardno: "",
            };
            for (let i = 0; i < this.columnData.length; i++) {
                for (let j = 0; j < this.columnData[i].length; j++) {
                    let col = this.columnData[i][j];
                    let colinfo = col.col_code;
                    let value = col.default_val;
                    if(type == "2" && col.rem_last == "1"){
                        //保存成功后，自动记忆
                        var list = this.InputCodeArr.filter((item) => item.key.indexOf(colinfo) > -1);
                        if (list.length > 0) {
                            this.masterList[list[0].key.split("$")[1]] = copyMasterList[list[0].key.split("$")[1]];
                            this.masterList[colinfo] = copyMasterList[colinfo];
                        }
                        else{
                            this.masterList[colinfo] = copyMasterList[colinfo];
                        }
                    }
                    else {
                        //赋默认值
                        if (col.default_val != "" ) {
                            var list = this.InputCodeArr.filter((item) => item.key.indexOf(colinfo) > -1);
                            if (list.length > 0) {
                                var row = list[0].list.Data.filter((item) => (item.inputcode + "").toUpperCase() == (value + "").toUpperCase() || (item.hidkey + "").toUpperCase() == (value + "").toUpperCase());
                                if (row.length > 0) {
                                    this.masterList[this.forminfo[colinfo].field.split("$")[1]] = row[0].hidname;
                                    this.masterList[colinfo] = row[0].hidkey;
                                } else {
                                    if (colinfo == "pat_sex" || colinfo == "pat_typecode" || colinfo == "specimen_code") {
                                        this.opendialog(col);
                                    } else {
                                        var re = new RegExp("[\\u4e00-\\u9fa5]", "gi");
                                        if (!re.test(value)) {
                                            this.opendialog(col);
                                        }
                                    }
                                }
                            } else {
                                if(col.col_code == 'sampled_dt' && col.default_val=="1"){
                                    this.masterList[col.col_code]="";
                                } else {
                                    this.masterList[col.col_code] = col.default_val;
                                }
                            }
                        }
                    }
                }
            }
            // 遍历 checkbox 选项，默认赋值
            this.columnDataChk.forEach(element => {
                element.forEach(item => {
                    this.masterList[item.col_code] = item.default_val;
                });
            });
            this.$forceUpdate();
            this.addrxTable(type);
            setTimeout(() => {
                let focusitem = this.columnData[0][0].col_code;
                console.log(focusitem);
                document.getElementById(focusitem).focus();
            }, 100);
            this.addreqitemname = "";
        },
        addrxTable(type) {
            if (this.ChkSaveThenNotClearItem == "0") {
                // 勾选保存后清空项目
                this.detail = [];
                //this.detail.push({ seq: this.detailseq, qty: "1" });
            }
            if (type != 1) {
                return false;
            }
            setTimeout(() => {
                if (this.ChkSaveThenNotClearItem != "1") {
                    this.$refs.rxTable.insertAt({ seq: this.detailseq, qty: "1" }, -1);
                }
            }, 100);
        },
        btnDelete() {
            try {
                var data = this.refsObj.getSelectRecords();
                if (data.length > 0) {
                    this.$confirm("本次选中 <span style='color:red;'>" + data.length + "</span> 条数据，确定删除勾选的申请吗？", "提示", {
                        dangerouslyUseHTMLString: true,
                        confirmButtonText: "确定",
                        cancelButtonText: "取消",
                        type: "warning",
                    })
                        .then(() => {
                            var delAction = "deleteRecord";
                            if(this.searchObj.isapproval == '1'){
                                delAction = "deleteApplicationRecord";
                            }
                            this.refsObj.removeSelecteds().then((e) => {
                                this.$tool
                                    .request({
                                        url: "LIS/LIS2/LIS251",
                                        method: "post",
                                        data: {
                                            action: delAction,
                                            deleteinfo: e.rows,
                                        },
                                    })
                                    .then((res) => {
                                        if (res.flag == "1") {
                                            this.actionindex = "M";
                                            this.$pub.message(this, "删除成功！", "success");
                                        } else {
                                            this.$pub.message(this, "删除失败！" + res.msg, "error");
                                        }
                                    });
                            });
                        })
                        .catch(() => {});
                } else {
                    var delrow = this.refsObj.getCurrentRow();
                    if (delrow) {
                        var msg = "确定删除条码号：<span style='color:red;'>" + delrow.barcode + "</span> 的申请吗？";
                        if(!delrow.barcode){
                            msg = "确定删除病人姓名：<span style='color:red;'>" + delrow.pat_name + "</span> 的申请吗？";
                        }
                        this.$confirm(msg, "提示", {
                            dangerouslyUseHTMLString: true,
                            confirmButtonText: "确定",
                            cancelButtonText: "取消",
                            type: "warning",
                        })
                            .then(() => {
                                var alld = this.refsObj.tableData;
                                var rowindex = alld.indexOf(delrow);
                                this.refsObj.remove(delrow);
                                this.actionindex = "D";
                                this.masterList = delrow;
                                if(this.searchObj.isapproval == '1'){
                                    this.saveToApplicationEntry().then((res) => {
                                        if (res.errcode == "1") {
                                            let havedata = this.refsObj.tableData;
                                            if (havedata.length > 0) {
                                                if (rowindex >= havedata.length) rowindex = havedata.length - 1;
                                                let selectrow = havedata[rowindex];
                                                this.HighLightRow(selectrow);
                                            } else {
                                                this.HighLightRow(false);
                                            }
                                            this.actionindex = "M";
                                            this.$pub.message(this, "删除成功！", "success");
                                        } else {
                                            this.$pub.message(this, "删除失败！" + res.errmsg, "error");
                                        }
                                    });
                                } else {
                                    this.save().then((res) => {
                                        if (res.errcode == "1") {
                                            let havedata = this.refsObj.tableData;
                                            if (havedata.length > 0) {
                                                if (rowindex >= havedata.length) rowindex = havedata.length - 1;
                                                let selectrow = havedata[rowindex];
                                                this.HighLightRow(selectrow);
                                            } else {
                                                this.HighLightRow(false);
                                            }
                                            this.actionindex = "M";
                                            this.$pub.message(this, "删除成功！", "success");
                                        } else {
                                            this.$pub.message(this, "删除失败！" + res.errmsg, "error");
                                        }
                                    });
                                }
                            })
                            .catch(() => {});
                    }
                }
            } catch (e) {
                console.log("error", e);
            }
        }, //保存
        async btnSave() {
            try {
                if (this.actionindex == "A") {
                    if(this.applyentryneedapproval == '1'){
                        this.tempsave();
                    }
                    else{
                        this.exesave();
                    }
                } else if (this.actionindex == "M") {
                    //数据修改
                    this.$confirm("确定要修改此申请单吗？", {
                        confirmButtonText: "确定",
                        cancelButtonText: "取消",
                        type: "warning",
                    })
                        .then(() => {
                            if(this.applyentryneedapproval == '1'){
                                this.tempsave();
                            }
                            else{
                                this.exesave();
                            }
                        })
                        .catch(() => {
                            this.getdetails();
                        });
                }
            } catch (e) {
                this.$alert(e, "信息");
            }
        }, //保存执行
        async exesave() {
            this.save().then((res) => {
                if (res.errcode == "1") {
                    this.$pub.message(this, "保存成功！", "success");
                    this.actionindex = "M";
                    if (this.reqLocalseting.reqprintbarcodeseting == "1") {
                        //打印条码
                        this.$pub.printbarcode(this, res.keyid, "1", this.barcodestyle, this.cxbarcodeprinter, "1");
                    }
                    if(this.reqLocalseting.reqprintreceiptseting == "1"){
                        //打印回单
                        if (res.collectbarcode.indexOf(",") > -1) {
                            res.collectbarcode.split(",").forEach((item) => {
                                if (item != "") {
                                    this.$pub.printbackbar(this, item, "1", this.cx_backrpt_style, this.pbackmode, this.cx_backrrintername);
                                }
                            });
                        } else {
                            this.$pub.printbackbar(this, res.collectbarcode, "1", this.cx_backrpt_style, this.pbackmode, this.cx_backrrintername);
                        }
                    }
                    this.queryData(res.keyid);
                    this.addreqitemname = "";
                    this.btnAdd(2);
                } else {
                    this.$pub.message(this, "保存失败！" + res.errmsg, "error");
                }
            });
        }, //form保存
        async tempsave(){
            this.saveToApplicationEntry().then((res) => {
                if (res.errcode == "1") {
                    this.$pub.message(this, "保存成功！", "success");
                    this.actionindex = "M";
                    this.searchObj.isapproval = '1';
                    this.queryData("");
                    this.addreqitemname = "";
                    this.btnAdd(2);
                }
                else{
                    this.$pub.message(this, "保存失败！" + res.errmsg, "error");
                }
            });
        },
        async save() {
            try {
                this.saveBeforeVerify();
                const result = await this.$tool.request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "saveRecord",
                        actionindex: this.actionindex,
                        saveinfo: this.masterList,
                        oldinfo: this.oldmasterList,
                        urec: this.$refs.rxTable.tableData,
                        ChkSaveThenNotClearItem: this.ChkSaveThenNotClearItem,
                    },
                });
                return result;
            } catch (e) {
                this.$alert(e);
            }
        },
        async saveToApplicationEntry(){
            try {
                this.saveBeforeVerify();
                const result = await this.$tool.request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "saveToApplicationEntry",
                        actionindex: this.actionindex,
                        saveinfo: this.masterList,
                        oldinfo: this.oldmasterList,
                        urec: this.$refs.rxTable.tableData,
                        ChkSaveThenNotClearItem: this.ChkSaveThenNotClearItem,
                    },
                });
                return result;
            } catch (e) {
                this.$alert(e);
            }
        },
        //保存前做一下校验
        saveBeforeVerify() {
            let data = this.$refs.rxTable.tableData;
            //写入分单类别
            if (data.length > 0) {
                this.masterList.req_groupid = data[0].req_groupid;
                this.masterList.req_groupna = data[0].req_groupname;
            }
            //写入申请项目简称
            if (data.length > 0) {
                let req_itemnas = "";
                data.forEach((item) => {
                    if (req_itemnas == "") {
                        req_itemnas = !!item.req_itemna ? item.req_itemna : item.req_itemname;
                    } else {
                        req_itemnas = req_itemnas + "," + (!!item.req_itemna ? item.req_itemna : item.req_itemname);
                    }
                });
                this.masterList.sample_items = req_itemnas;
            }
        },
        //保存成功后不清空项目的保存
        async exesave_NotClearItem() {
            this.saveBeforeVerify();
            const result = await this.$tool.request({
                url: "LIS/LIS2/LIS251",
                method: "post",
                data: {
                    action: "saveRecord",
                    actionindex: this.actionindex,
                    saveinfo: this.masterList,
                    oldinfo: this.oldmasterList,
                    urec: this.$refs.rxTable.tableData,
                    ChkSaveThenNotClearItem: this.ChkSaveThenNotClearItem,
                },
            });
            return result;
        },
        btnCancel() {
            console.log("btnCancel");
            this.$confirm("您确定要取消这次改动吗？", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    this.getdetails(this.selectRow);
                    this.changeflag = false;
                    this.haveUpt = this.fhaveUpt;
                    this.addreqitemname = "";
                    this.actionindex="M";
                })
                .catch(() => {});
        },
        btnPrint() {
            if (this.barcodestyle != "") {
                let barcodestr = "";
                if (this.ChkSupportMutiplePrint == "1") {
                    //支持多选打印
                    let data = this.refsObj.getSelectRecords();
                    if (data.length > 0) {
                        const rLoading = this.$pub.openLoading(this, "正在打印条码……");
                        data.forEach((item) => {
                            if (barcodestr == "") {
                                barcodestr = item.barcode;
                            } else {
                                barcodestr = barcodestr + "," + item.barcode;
                            }
                        });
                        this.$pub.printbarcode(this, barcodestr, "1", this.barcodestyle, this.cxbarcodeprinter, "1");
                        rLoading.close();
                    } else {
                        this.$alert("请勾选需要打印的数据！", "提示");
                    }
                } else {
                    let data = this.refsObj.getCurrentRow();
                    if (!!data) {
                        barcodestr = data.barcode;
                        this.$pub.printbarcode(this, barcodestr, "1", this.barcodestyle, this.cxbarcodeprinter, "1");
                    } else {
                        this.$alert("请选择需要打印的数据！", "提示");
                    }
                }
            } else {
                this.$alert("没有设置条码的打印样式", "错误", {
                    confirmButtonText: "确定",
                });
            }
        },
        btnPrintCo() {
            if (this.cx_backrpt_style != "") {
                //支持多选打印
                let data = this.refsObj.getSelectRecords();
                if (data.length > 0) {
                    const rLoading = this.$pub.openLoading(this, "正在打印回单……");
                    data.forEach((item) => {
                        this.$pub.printbackbar(this, item.collectbarcode, "1", this.cx_backrpt_style, this.pbackmode, this.cx_backrrintername);
                    });
                    rLoading.close();
                } else {
                    this.$alert("请勾选需要打印回单的数据！", "提示");
                }
            } else {
                this.$alert("没有设置回单的打印样式", "错误", {
                    confirmButtonText: "确定",
                });
            }
        },
        btnCopy() {
            this.masterListCopy = XEUtils.clone(this.masterList, true);
        },
        btnPaste() {
            this.masterListCopy.barcode = "";
            this.masterList = this.masterListCopy;
        },
        btnSet() {
            this.dialogSetting = true;
        },
        btnBatchCopy() {
            let data = this.refsObj.getCurrentRow();
            if (!!data) {
                this.batchcopyVisible=true;
            } else {
                this.$alert("请选择需要批量复制的数据！", "提示");
            }
        },
        changeIsApplyentry(){
            if((this.searchObj.isapproval == '0' && !!this.searchObj.approvalstate) || (this.searchObj.isapproval == '1' && !this.searchObj.approvalstate)){
                this.master = [];
            }
            if(!!this.searchObj.approvalstate){
                this.refsObj = this.$refs.lxTableTemp;
                this.searchObj.isapproval = '1';
            }
            else{
                this.refsObj = this.$refs.lxTable;
                this.searchObj.isapproval = '0';
            }
        },
        btnGroup() {},
        btnExport() {},
        //存为默认
        btnSaveDefault() {
            let jsondate = {
                txtpattype: this.searchObj.txtpattype,
                txtcreateuser: this.searchObj.txtcreateuser,
                txtpatname: this.searchObj.txtpatname,
                txtpatno: this.searchObj.txtpatno,
                txtreqitem: this.searchObj.txtreqitem,
                txthospcode: this.searchObj.txthospcode,
                txtreqdeptno: this.searchObj.txtreqdeptno,
                txtreqstat: this.searchObj.txtreqstat,
                txtbarcode: this.searchObj.txtbarcode,
                isapproval: this.searchObj.isapproval,
                approvalstate: this.searchObj.approvalstate,
                ChkSaveThenPrintLabel: this.ChkSaveThenPrintLabel,
                ChkAutoAssignLabelQty: this.ChkAutoAssignLabelQty,
                ChkReqitemAutoemory: this.ChkReqitemAutoemory,
                ChkNoShowReqBarcode: this.ChkNoShowReqBarcode,
                ChkNoShowPatnoThenCreateBarcode: this.ChkNoShowPatnoThenCreateBarcode,
                ChkSupportMutiplePrint: this.ChkSupportMutiplePrint,
            };
            let modListJson = JSON.stringify(jsondate);
            localStorage.setItem("rm_Qmod_LIS251", modListJson);
            this.$alert("条件已存为默认，首次加载页面时条件自动填充！", "信息");
        },
        //申请项目数据回传
        reqitemchange(code, name, row) {
            var rptlist = this.$refs.rxTable.getTableData().fullData;
            var data3 = XEUtils.clone(rptlist, true);
            if (code && code.length > 0) {
                // console.log(code, name, row);
                for (let i = 0; i < code.length; i++) {
                    var rpt = code[i];
                    console.log(rpt, rpt.req_itemcode);
                    var data = data3.find((m) => m.req_itemcode == rpt.req_itemcode);
                    // console.log(data);
                    if (!data) {
                        // if (!data.req_itemcode) {
                        var selectrow = this.allReqsheetList.find((t) => t.req_itemcode == rpt.req_itemcode);
                        if (selectrow) {
                            if (i == code.length - 1) {
                                this.$refs.rxTable.insert({ req_itemname: rpt.req_itemname, req_itemcode: rpt.req_itemcode, item_price: rpt.item_price, amount: rpt.amount, specimen_code: rpt.specimen_code, req_groupname: code[i].req_groupname, req_groupid: rpt.req_groupid, seq: this.detailseq, qty: 1 }).then((rows) => {
                                    this.$refs.rxTable.setCurrentRow(rows.row);
                                    // this.$refs.rxTable.setActiveCell(rows.row, "req_itemcode");
                                });
                            } else {
                                this.$refs.rxTable.insert({ req_itemname: rpt.req_itemname, req_itemcode: rpt.req_itemcode, item_price: rpt.item_price, amount: rpt.amount, specimen_code: rpt.specimen_code, req_groupname: code[i].req_groupname, req_groupid: rpt.req_groupid, seq: this.detailseq, qty: 1 });
                            }
                        }
                    }
                    // } else {
                    //     // this.$refs.rxTable.insert({ seq: this.detailseq, qty: 1 }).then(rows => {
                    //     //     this.$refs.rxTable.setCurrentRow(rows.row);
                    //     //     this.$refs.rxTable.setActiveCell(rows.row, "req_itemcode");
                    //     // });
                    //     var nowrow = this.$refs.rxTable.getCurrentRow();
                    //     nowrow.req_itemcode = "";
                    // }
                }
            }
            // this.dblclickRow.req_itemname = name;
            // this.dblclickRow.req_itemcode = code;
            // this.dblclickRow.item_price = row.item_price;
            // this.dblclickRow.amount = row.item_price;
            // this.dblclickRow.req_groupname = row.req_groupname;
            // this.dblclickRow.req_groupid = row.req_groupid;
            // this.dblclickRow.req_groupna = row.req_groupna;
            // this.dblclickRow.req_itemna = row.req_itemna;
            //  console.log("data", data);
            // if (data.length > 0) {
            //     let data1 = data[0];
            //     this.dblclickRow.req_itemname = data1.req_itemname;
            //     this.dblclickRow.req_itemcode = data1.req_itemcode;
            //     this.dblclickRow.item_price = data1.item_price;
            //     this.dblclickRow.amount = data1.item_price;
            //     this.dblclickRow.req_groupname = data1.req_groupname;
            //     this.dblclickRow.req_groupid = data1.req_groupid;
            //     if (data.length > 1) {
            //         let data2 = data.splice(0, 1);
            //         console.log("data2", data2);
            //         let data3 = this.$refs.rxTable.tableData;
            //         data2.forEach((item) => {
            //             if (data3.filter((m) => m.req_itemcode == item.req_itemcode).length == 0) {
            //                 this.$refs.rxTable.insert({ req_itemname: item.req_itemname, req_itemcode: item.req_itemcode, item_price: item.item_price, amount: item.amount, req_groupname: item.req_groupname, req_groupid: item.req_groupid, seq: this.seq, qty: "1" }).then(({ row }) => {
            //                     this.$refs.rxTable.setCurrentRow(row);
            //                 });
            //             }
            //         });
            //         this.changeflag = true;
            //     }
            // }
            this.changeflag = true;
            this.dialogReqItem = false;
            this.dialogReqItem1 = false;
        },
        // 回车切换输入框
        nextFocus(colcode, index) {
            if (index > 26) return false;
            if (colcode == "pat_no") {
                // 输入病历号 获取病人信息
                this.$tool
                    .request({
                        url: "LIS/LIS2/LIS251",
                        method: "post",
                        data: {
                            action: "getpatinfo",
                            pat_no: this.masterList.pat_no,
                            pat_typecode: this.masterList.pat_typecode,
                        },
                    })
                    .then((res) => {
                        if (res.flag == 1) {
                            this.masterList = res.patinfo.patient;
                            this.masterList.req_deptno = res.patinfo.patient.req_deptno; // 申请科室
                            this.masterList.hospname = res.patinfo.patient.hospcodename; // 送检医院
                            this.masterList.req_deptname = res.patinfo.patient.req_deptnoname; // 申请科室
                            this.masterList.req_wardname = res.patinfo.patient.req_wardnoname; // 申请病区
                            this.masterList.req_docname = res.patinfo.patient.req_docnoname; // 申请医生
                            this.masterList.pat_typename = res.patinfo.patient.pat_typecodename; // 病人来源
                            this.masterList.pat_hospname = res.pat_hospname; //病人医院
                        }
                        this.nextgetFocus(index);
                    });
            } else {
                this.nextgetFocus(index);
            }
        },
        nextgetFocus(index) {
            var that = this;
            var focusIndex = index + 1;
            setTimeout(function () {
                if (that.$refs["input" + focusIndex]) {
                    that.$refs["input" + focusIndex][0].focus();
                    if (["_dt", "_date"].indexOf(that.$refs["input" + focusIndex][0].id) == -1) {
                        //  that.HightlightPos(that.$refs["input" + focusIndex][0].value, colcode, index);
                    } else {
                        that.$refs["input" + focusIndex][0].select();
                    }
                } else {
                    that.$refs.reqselect.$refs.tableSelect.focus();
                }
            }, 1);
        },

        InputFocus(colcode, index) {
            let that = this;
            //that.$refs["input" + index][0].select();
            //console.log("GSGAH", that.$refs["input" + index]);
            that.HightlightPos(that.$refs["input" + index][0].value, colcode, index);
        },
        InputMove(moveDirection, colcode, index) {
            if (moveDirection == "up") {
                if (index == 1) return false;
                var that = this;
                var focusIndex = index - 1;
                setTimeout(function () {
                    that.$refs["input" + focusIndex][0].focus();
                    if (["_dt", "_date", "pat_birth"].indexOf(that.$refs["input" + focusIndex][0].id) == -1) {
                    } else {
                        that.$refs["input" + focusIndex][0].select();
                    }
                }, 1);
            } else {
                this.nextFocus(colcode, index);
            }
        },
        hasChange() {
            this.changeflag = true;
        },
        popcomchange(code, name) {
            let field = this.field.split("$");
            this.masterList[field[0]] = code;
            this.masterList[field[1]] = name;
            this.dialogform = false;
            this.$refs[field[2]][0].focus();
            this.$refs[field[2]][0].select();
            this.hasChange();
        },
        opendialog(col) {
            if (col.noedit == "1") return false;
            this.dialogkey++;
            console.log(this.forminfo);
            let info = this.forminfo[col.col_code];
            if (!info) return false;
            let action = info.action.split("$");
            // let field = info.field.split("$");
            this.dialogtitle = info.title;
            this.datatype = action[0];
            this.kindno = action[1];
            this.field = info.field + "$" + "input" + col.seqflag;
            this.dialogform = true;
        },
        async inputChangeEvent(value, colinfo, refinfo) {
            switch (colinfo) {
                case "pat_agestr":
                    this.masterList.pat_birth = ""; //清空生日
                    var reg = new RegExp("\\d{1,}(y|Y|岁|年){0,}\\d{0,}(m|M|月){0,}\\d{0,}(d|D|日){0,}\\d{0,}(h|H|小时){0,}\\d{0,}(f|F|分钟){0,}", "gi");
                    var regd = new RegExp("^\\d{1,}$", "gi");
                    var regda = new RegExp("\\d{1,}", "gi");
                    if (value.match(regd)) {
                        this.masterList[colinfo] = value + "岁";
                        this.masterList["pat_ageyear"] = value - 0;
                    } else if (value.match(reg)) {
                        this.masterList[colinfo] = value.replace("y", "岁").replace("年", "岁").replace("Y", "岁").replace("m", "月").replace("M", "月").replace("d", "日").replace("D", "日").replace("h", "小时").replace("H", "小时").replace("f", "分钟").replace("F", "分钟") + "";
                        this.masterList.pat_ageyear = this.$pub.ageTransform(this.masterList.pat_agestr);
                    } else {
                        this.$confirm("无效的病人年龄!", "提示", {
                            confirmButtonText: "确定",
                            cancelButtonText: "取消",
                            focusCancelButton: false,
                            closeOnClickModal: false,
                            type: "warning",
                        })
                            .then(() => {})
                            .catch(() => {});
                    }
                    break;
                case "pat_birth":
                    const result = await this.computedAgeORbirth(colinfo, value);
                    //不根据年龄推算生日了，推算的也是错的
                    // if (colinfo == "pat_agestr") {
                    //     this.masterList.pat_agestr = value;
                    //     this.masterList.pat_ageyear = result.Item1;
                    //     this.masterList.pat_birth = result.Item2;
                    // } else {
                    this.masterList.pat_agestr = result; //只推算年龄
                    // this.masterList.pat_ageyear = result;
                    this.$forceUpdate();
                    // }
                    this.hasChange();
                    break;
                case "pat_idcardno":
                    this.calcBirthAgeSex(value);
                    break;
                default:
                    if (value.trim()) {
                        var list = this.InputCodeArr.filter((item) => item.key.indexOf(colinfo) > -1);
                        if (list.length > 0) {
                            var row = list[0].list.Data.filter((item) => (item.inputcode + "").toUpperCase() == (value + "").toUpperCase() || (item.hidkey + "").toUpperCase() == (value + "").toUpperCase());
                            if (row.length > 0) {
                                this.masterList[this.forminfo[colinfo].field.split("$")[1]] = row[0].hidname;
                                this.masterList[colinfo] = row[0].hidkey;
                            } else {
                                if (colinfo == "pat_sex" || colinfo == "pat_typecode" || colinfo == "specimen_code") {
                                    this.opendialog(row[0]);
                                } else {
                                    var re = new RegExp("[\\u4e00-\\u9fa5]", "gi");
                                    if (!re.test(value)) {
                                        this.opendialog(row[0]);
                                    }
                                }
                            }
                        }
                    } else {
                        this.masterList[this.forminfo[colinfo].field.split("$")[1]] = "";
                        this.masterList[colinfo] = "";
                    }
                    break;
            }
        },
        async computedAgeORbirth(colinfo, value) {
            try {
                const result = await this.$tool.request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "patageOrpatbirth",
                        mod: colinfo,
                        value: value,
                    },
                });
                return result;
            } catch (e) {
                this.$alert(e, "出错");
            }
        },
        calcBirthAgeSex(pat_idcardno) {
            var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
            if (!pat_idcardno) return false;
            if (reg.test(pat_idcardno)) {
                if (parseInt(pat_idcardno.substr(16, 1)) % 2 == 1) {
                    // 获取性别
                    this.masterList.pat_sex = "1";
                    this.masterList.pat_sexname = "男";
                } else {
                    this.masterList.pat_sex = "2";
                    this.masterList.pat_sexname = "女";
                }
                // 获取出生日期
                this.masterList.pat_birth = pat_idcardno.substring(6, 10) + "-" + pat_idcardno.substring(10, 12) + "-" + pat_idcardno.substring(12, 14);
                let yearBirth = pat_idcardno.substring(6, 10);
                let monthBirth = pat_idcardno.substring(10, 12);
                let dayBirth = pat_idcardno.substring(12, 14);
                // 获取当前年月日并计算年龄
                let myDate = new Date();
                let monthNow = myDate.getMonth() + 1;
                let dayNow = myDate.getDate();
                let age = myDate.getFullYear() - yearBirth;
                if (monthNow < monthBirth || (monthNow == monthBirth && dayNow < dayBirth)) {
                    age--;
                }
                // 得到年龄
                this.masterList.pat_agestr = age;
            } else {
                this.$alert("请输入有效身份证号码！", "提示");
            }
        },
        SpaceEvent(col) {
            var val = this.masterList[this.forminfo[col.col_code].field.split("$")[1]];
            if (!val.replace(/\s*/g, "")) {
                this.opendialog(col);
            }
        },
        RowClassName({ row }) {
            return this.$pub.getreqstatclass(row.req_stat);
        }, //明细删除
        btnDeleteDetail() {
            if (this.nodata) {
                return false;
            } else {
                var delrow = this.$refs.rxTable.getCurrentRow();
                if (delrow) {
                    var alld = this.$refs.rxTable.tableData;
                    var rowindex = alld.indexOf(delrow);
                    this.$refs.rxTable.remove(delrow);
                    let havedata = this.$refs.rxTable.tableData;
                    if (havedata.length > 0) {
                        if (rowindex >= havedata.length) rowindex = havedata.length - 1;
                        let selectrow = havedata[rowindex];
                        this.$refs.rxTable.setCurrentRow(selectrow);
                        this.changeflag = true;
                    }
                }
            }
        }, //明细新增
        btnAddDetail(type, e) {
            console.log(type, e);
            if (this.nodata) {
                //如果没有数据禁止添加明细，得先点击新增
                // this.addreqitemname = "";
                // this.allReqsheetList = XEUtils.clone(this.fallReqsheetList, true);
                return false;
            } else {
                if (type == 1 && e) {
                    let req = this.fallReqsheetList.find((item) => item.req_itemcode == e);
                    console.log(req);
                    if (req) {
                        if (req.hasOwnProperty("tc")) {
                            console.log("套餐");
                            this.queryReqsheetitems(e, 1);
                        } else {
                            let arr = [
                                {
                                    seq: this.detailseq,
                                    qty: 1,
                                    req_itemcode: req.req_itemcode,
                                    req_itemname: req.req_itemname,
                                    item_price: req.item_price,
                                    amount: req.item_price,
                                    specimen_code: req.specimen_code,
                                    req_groupname: req.req_groupname,
                                },
                            ];
                            this.reqitemchange(arr);
                            this.changeflag = true;
                        }
                    }
                } else if (type == 2) {
                    // 分类弹窗
                    this.dialogReqItem = true;
                } else if (type == 3) {
                    // 套餐弹窗
                    this.dialogReqItem1 = true;
                } else {
                    let arr = {
                        seq: this.detailseq,
                        qty: 1,
                    };
                    this.$refs.rxTable.insert(arr).then((rows) => {
                        this.$refs.rxTable.setCurrentRow(rows.row);
                        this.$refs.rxTable.setActiveCell(rows.row, "req_itemcode");
                    });
                    this.changeflag = true;
                }
            }
        },
        changeReqitem(selectrow, row) {
            if (!selectrow) {
                row.req_itemcode = "";
                row.req_itemname = "";
                row.specimen_code = "";
                row.req_groupname = "";
                row.qty = "";
                row.item_price = "";
                row.amount = "";
                return false;
            }
            var e = selectrow.req_itemcode;
            console.log(selectrow, e, row);
            let req = this.fallReqsheetList.find((item) => item.req_itemcode == e);
            // console.log(req)
            if (req) {
                if (req.hasOwnProperty("tc")) {
                    console.log("套餐");
                    this.queryReqsheetitems(e, 1);
                } else {
                    let rpt = {
                        seq: this.detailseq,
                        qty: 1,
                        req_itemcode: e,
                        specimen_code: selectrow.specimen_code,
                        // req_itemname: req.req_itemname
                    };
                    // this.reqitemchange(arr);
                    var rptlist = this.$refs.rxTable.getTableData().fullData;
                    console.log(rptlist);
                    var data3 = XEUtils.clone(rptlist, true);
                    var data = data3.filter((m) => m.req_itemcode == rpt.req_itemcode);
                    console.log(data, row.req_itemcode);
                    if (!row.req_itemcode) {
                        if (data.length < 1) {
                            //     this.$refs.rxTable.insert({ req_itemname: rpt.req_itemname, req_itemcode: rpt.req_itemcode, item_price: rpt.item_price, amount: rpt.amount, specimen_name: rpt.specimen_name, req_groupname: rpt.req_groupname, req_groupid: rpt.req_groupid, seq: this.detailseq, qty: rpt.qty });
                            // } else if (data.length == 1) {
                            row.req_itemcode = rpt.req_itemcode;
                            var selectrow = this.allReqsheetList.find((t) => t.req_itemcode == rpt.req_itemcode);
                            if (selectrow) {
                                row.specimen_code = selectrow.specimen_code;
                                row.req_groupname = selectrow.req_groupname;
                                row.item_price = selectrow.item_price;
                                row.amount = selectrow.item_price * row.qty;
                            }
                            this.$refs.rxTable.insert({ seq: this.detailseq, qty: 1 }).then((rows) => {
                                this.$refs.rxTable.setCurrentRow(rows.row);
                                this.$refs.rxTable.setActiveCell(rows.row, "req_itemcode");
                            });
                        } else {
                            row.req_itemcode = "";
                            row.req_itemname = "";
                            row.specimen_code = "";
                            row.req_groupname = "";
                            row.item_price = "";
                            row.amount = "";
                        }
                    } else {
                        row.req_itemcode = e;
                        row.req_itemname = selectrow.req_itemname;
                        row.specimen_code = selectrow.specimen_code;
                        row.req_groupname = selectrow.req_groupname;
                        row.item_price = selectrow.item_price;
                        row.amount = selectrow.item_price;
                        this.$refs.rxTable.clearActived();
                    }
                    this.changeflag = true;
                }
            }
        },
        HightlightPos(myValue, colcode, index) {
            if (!myValue) myValue = "";
            try {
                var myField = {};
                if (colcode.toUpperCase().indexOf("_DT") == -1 || colcode.toUpperCase().indexOf("_DATE") == -1 || colcode == "pat_birth") {
                    myField = this.$refs["input" + index][0].$refs.reference.$refs.input;
                } else {
                    myField = this.$refs["input" + index][0].$refs.input;
                }
                if (myField.selectionStart || myField.selectionStart === 0) {
                    var startPos = myField.selectionStart;
                    var endPos = myField.selectionEnd;
                    this.$nextTick(() => {
                        myField.selectionStart = 0;
                        myField.selectionEnd = startPos + myValue.length;
                    }); // 这句是重点, 圈起来
                    myField.focus();
                    myField.setSelectionRange(myField, myField.selectionStart, myField.selectionEnd);
                }
            } catch (e) {}
        }, //设置保存
        async dialogSettingSave() {
            let xtabledata = this.$refs.psetTable.tableData;
            xtabledata.sort((a, b) => {
                return a.seq_no - b.seq_no;
            });
            for (let i = 0, len = xtabledata.length; i < len; i++) {
                xtabledata[i].seq_no = (i + 1) * 10;
            }
            const res = await this.$tool.request({
                url: "LIS/LIS2/LIS251",
                method: "post",
                data: {
                    action: "dialogSettingSave",
                    urec: this.$refs.psetTable.getRecordset(),
                    sysno: "LIS",
                    ...this.reqLocalseting,
                    dcinputcol: this.$refs.psetTable.getTableData().fullData,
                },
            });
            if (res.errcode == "1") {
                this.$pub.message(this, "保存成功", "success");
                this.initData();
                //this.dialogSetting = false;
            } else {
                this.$pub.message(this, "保存失败" + res.errmsg, "error");
            }
        },
        dialogSettingCancel() {
            this.dialogSetting = false;
        },
        preInputloaclseting(e) {
            console.log(e);
            let msg = "";
            let cancelValue = "";
            if (e == "0") {
                msg = "取消字段本地存储，将对全局设置进行修改，是否继续?";
                cancelValue = "1";
            } else {
                msg = "勾选字段本地存储，修改仅对本机生效，是否继续?";
                cancelValue = "0";
            }
            this.$confirm(msg, "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    this.getDcinputcol();
                })
                .catch(() => {
                    this.reqLocalseting.reqinputloaclseting = cancelValue;
                });
        },
        prePrintloaclseting(e) {
            this.getPrintDcinputcol();
        },
        reqPrintBarcodeSeting(e) {
            this.getPrintBarcodeDcinputcol();
        },
        reqReadIDCardSeting(e) {
            this.getReadIDCardDcinputcol();
        },
        SaveNotClearItemChange() {
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "saveNotClearItem",
                        savenotclearitem: this.ChkSaveThenNotClearItem,
                    },
                })
                .then((res) => {
                    if (res.flag == "1") {
                        this.$pub.message(this, "保存成功", "success");
                    } else {
                        this.$pub.message(this, "保存失败" + res.msg, "error");
                    }
                });
        },
        getDcinputcol() {
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "getdcinputcol",
                        reqinputloaclseting: this.reqLocalseting.reqinputloaclseting,
                    },
                })
                .then((res) => {
                    if (res.flag == "1") {
                        this.$pub.message(this, "保存成功", "success");
                        this.settingData = res.columnData;
                    } else {
                        this.$pub.message(this, "保存失败" + res.msg, "error");
                    }
                });
        },
        getPrintDcinputcol() {
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "saveReqPrintSeting",
                        reqprintreceiptseting: this.reqLocalseting.reqprintreceiptseting,
                    },
                })
                .then((res) => {
                    if (res.flag == "1") {
                        this.$pub.message(this, "保存成功", "success");
                    } else {
                        this.$pub.message(this, "保存失败" + res.msg, "error");
                    }
                });
        },
        getPrintBarcodeDcinputcol() {
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "saveReqPrintBarcodeSeting",
                        reqprintbarcodeseting: this.reqLocalseting.reqprintbarcodeseting,
                    },
                })
                .then((res) => {
                    if (res.flag == "1") {
                        this.$pub.message(this, "保存成功", "success");
                    } else {
                        this.$pub.message(this, "保存失败" + res.msg, "error");
                    }
                });
        },
        getReadIDCardDcinputcol() {
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "saveReqReadIDCardSeting",
                        reqreadidcardseting: this.reqLocalseting.reqreadidcardseting,
                    },
                })
                .then((res) => {
                    if (res.flag == "1") {
                        this.$pub.message(this, "保存成功", "success");
                    } else {
                        this.$pub.message(this, "保存失败" + res.msg, "error");
                    }
                });
        },
        dblclickLXTable({ row, column }) {
            //正式表双击事件
            if(column.property == 'isPhoto'){
                //弹窗预览图片
                this.getImage(row,'req');
            }
        },
        dblclickTemp({ row, column }) {
            //temp表双击事件
            if(column.property == 'isPhoto'){
                //弹窗预览图片
                this.getImage(row,'temp');
            }
        },
        async getImage(row , type) {
            this.LPicData = [];
            if(row.isPhoto != '0'){
                //获取图片
                let barcode = '';
                if(type == 'temp'){
                    barcode = row.id;
                }
                else {
                    barcode = row.barcode;
                }
                const r = await this.$tool.request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "getimage",
                        type: type,
                        barcode: barcode,
                    },
                });
                if (r.images.length > 0) {
                    r.images.forEach(element => {
                        this.LPicData.push(element.Item1);
                    });
                    //打开弹窗展示图片
                    this.photoDialog = true;
                    this.showPhotoBtn = '0';
                    this.titlePhotoDlg = '查看图片';
                }
            }
        },
        btn_photo(){
            var cRow = this.refsObj.getCurrentRow();
            if(!!cRow){
                if(cRow.approveflag == '1'){
                    this.$alert("已审核的医嘱不允许修改！", "提示");
                    return false;
                }
                this.currRow = cRow;
                this.photoDialog = true;
            }
            else {
                this.$alert("请选择需要拍照的医嘱！", "提示");
            }
        },
        btnTakePhoto(){
            if (typeof jsObj != "undefined") {
                //jsObj.AsyncCall("入参");  js这边就这样调用
                var s = jsObj.AsyncCall("callexe:ImageCatch.exe");
            } else {
                this.$alert("请使用" + this.$pub.clientname + "打开系统", "错误", {
                    confirmButtonText: "确定",
                });
            }
        },
        imagecatch(imgbase64) {
            console.log("saveimage");
            var imagedata = "data:image/png;base64," + imgbase64;
            var imageS = imagedata + "$image_split$";
            this.reqimage += imageS;
            this.LPicData.push(imagedata);
            this.$message.success("已拍摄完成！");
        },
        onPreview(imgList) {
            this.viewerList = [imgList];
            this.showViewer = true
        },
        closeViewer() {
            this.viewerList = [];
            this.showViewer = false
        },
        deletepic(img){
            if(!!img){
                var index = this.LPicData.findIndex((m) => m == img);
                //删除
                this.LPicData.splice(index,1);
                this.reqimage = '';
                for(var i = 0; i < this.LPicData.length; i++){
                    let itemImg = this.LPicData[i] + "$image_split$";
                    this.reqimage += itemImg;
                }
            }
        },
        savePhoto(){
            let barcode = '';
            if(this.searchObj.isapproval == '1') {
                //查询的是审核数据，通过id来绑定
                barcode = this.currRow.id;
            }
            else if (this.searchObj.isapproval == '0'){
                barcode = this.currRow.barcode;
            }
            this.$tool
                .request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "savePhoto",
                        isapproval: this.searchObj.isapproval,
                        reqimage: this.reqimage,
                        barcode: barcode,
                    },
                })
                .then((res) => {
                    if(res.flag == '1'){
                        this.$message.success("保存成功！");
                        this.photoDialog = false;
                    }
                    else {
                        this.$alert(res.msg, "错误", {
                            confirmButtonText: "确定",
                        });
                    }
                })
                .catch((e) => {
                    console.log("error", e);
                });
        },
        cancelPhoto(){
            this.photoDialog = false;
        },
        clearPhoto(){
            this.LPicData = [];
            this.reqimage = '';
            this.showPhotoBtn ='1';
            this.titlePhotoDlg ="拍照";
        },
        req_statChange(code, name) {
            this.searchObj.txtreqstat = code;
            this.txtreqstatname = name;
        },
        deptChange(code, name) {
            this.searchObj.txtreqdeptno = code;
            this.txtreqdeptname = name;
        },
        hospitalChange(code, name) {
            this.searchObj.txthospcode = code;
            this.txthospname = name;
        },
        reqitemChange(code, name) {
            this.searchObj.txtreqitem = code;
            this.txtreqitemname = name;
        },
        PTChange(code, name) {
            this.searchObj.txtpattype = code;
            this.txtpattypename = name;
        },
        userinfoChange(code, name) {
            this.searchObj.txtcreateuser = code;
            this.txtcreateusername = name;
        },
        currentReqsheetChange({ row }) {
            if (row.req_sheetid) {
                this.queryReqsheetitems(row.req_sheetid);
            }
        },
        queryReqsheet() {
            var that = this;
            that.$tool
                .request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "queryreqsheet",
                    },
                })
                .then((res) => {
                    if (res.errcode == "1") {
                        // that.reqsheetList = res.reqsheet;
                        if (res.reqsheet) {
                            res.reqsheet.forEach((element) => {
                                that.allReqsheetList.push({
                                    req_itemname: "套餐：" + element.sheet_name,
                                    req_itemcode: element.req_sheetid.toString(),
                                    inputcode: element.inputcode ? element.inputcode : "",
                                    tc: "tc",
                                });
                            });
                        }
                        that.fallReqsheetList = XEUtils.clone(that.allReqsheetList, true);
                        // that.allReqsheetList = [];
                    }
                })
                .catch((e) => {
                    console.log("error", e);
                });
        },
        // 查询申请_开单套餐_项目
        queryReqsheetitems(reqsheetid, type) {
            var that = this;
            that.$tool
                .request({
                    url: "LIS/LIS2/LIS251",
                    method: "post",
                    data: {
                        action: "queryreqsheetitem",
                        req_sheetid: reqsheetid,
                    },
                })
                .then((response) => {
                    if (type == 1) {
                        // 新增项目，插入套餐项目
                        if (response.details.length > 0) {
                            that.reqitemchange(response.details);
                            that.changeflag = true;
                        }
                    }
                })
                .catch((e) => {});
        },
        saveAsSheet() {
            if (this.$refs.rxTable.getTableData().fullData.length == 0) {
                return false;
            }
            // console.log(this.dept)
            this.reqsheetParam = {
                sheet_deptno: this.dept[0].performby,
                deptname: this.dept[0].deptname,
            };
            this.saveReqsheetVisible = true;
        },
        dealReqsheet(type) {
            var that = this;
            if (type == 1) {
                if (that.reqsheetParam.sheet_name == undefined || that.reqsheetParam.sheet_name == "") {
                    that.$alert("请输入套餐名称", "提示", {
                        confirmButtonText: "确定",
                        callback: (action) => {},
                    });
                    return false;
                }
                var reqsheetitems = {
                    insertRecords: that.$refs.rxTable.getTableData().fullData,
                };
                that.$tool
                    .request({
                        url: "LIS/LIS2/LIS251",
                        method: "post",
                        data: {
                            action: "savereqsheet",
                            prono: "LIS251",
                            req_sheetid: that.reqsheetParam.req_sheetid,
                            reqsheet: that.reqsheetParam,
                            reqsheetitems: reqsheetitems,
                            utype: 1,
                        },
                    })
                    .then((response) => {
                        if (response.errcode != "1") {
                            that.$message({
                                message: "保存失败！" + response.errmsg,
                                type: "warning",
                            });
                        } else {
                            that.$message({
                                message: "保存成功！",
                                type: "success",
                            });
                            that.saveReqsheetVisible = false;
                        }
                    })
                    .catch((e) => {});
            } else {
                that.saveReqsheetVisible = false;
            }
        },
        closeReqitem(type, ref) {
            if (type == 1) {
                // 组件
                this.$refs[ref].$refs.xTable.clearSelection();
            } else {
                this.$refs[ref].clearSelection();
            }
        },
        getShowName(code, list, row) {
            if (row) {
                row.req_itemname = this[list + "Map"].get(code);
            }
            return this[list + "Map"].get(code);
        },
        chooseReqsheet(type, data) {
            if (type == 1) {
                // 有数据修改回传
                console.log(data);
                this.reqitemchange(data);
            }
            this.dialogReqItem1 = false;
        },
        activeMethod({ row, column }) {
            if (column.property == "req_itemcode" && !this.nodata) {
                return true;
            }
        },
        selectChange(row) {
            console.log(row);
            if (row) {
                this.addreqitemname = row.req_itemname;
                this.btnAddDetail(1, row.req_itemcode);
            } else {
                this.addreqitemname = "";
            }
        },
        applyImport() {
            this.importDialog = true;
        },
        reqImportChange() {
            this.importDialog = false;
        },
        reqitemDialogShow(e, row, judgeflag) {
            if (!e || !e.target) return false;
            // console.log(e.target.value, row, judgeflag);
            let inputval = e.target.value; // 筛选的 input 值
            this.dealTableDataList({ req_itemcode: inputval });
            if (e) {
                if (judgeflag) {
                    let selrow = this.fallReqsheetList.find((item) => item.req_itemcode == e.target.value);
                    if (selrow) {
                        this.selectTableRow(selrow);
                    } else {
                        this.selectTableRow({});
                    }
                    setTimeout(() => {
                        this.reqitemDialog = false;
                    }, 500);
                    // this.reqitemDialog = false;
                    return false;
                }
                if (e.keyCode == 13) {
                    this.selectTableRow(this.$refs.selectTable.getCurrentRow());
                    this.reqitemDialog = false;
                } else {
                    this.dealTableDataList(row);
                    let rect = e.target.getBoundingClientRect();
                    this.testDialogX = rect.left - rect.width / 2;
                    this.testDialogY = rect.top - (rect.height * 3) / 2;
                    this.reqitemDialog = true;
                }
            } else {
                this.reqitemDialog = false;
            }
        },
        dealTableDataList(row) {
            var tableDataList = [];
            if (row && row.req_itemcode) {
                let list = this.fallReqsheetList.filter((item) => (item.req_itemcode && item.req_itemcode.toUpperCase().indexOf(row.req_itemcode.toUpperCase()) > -1) || (item.req_itemname && item.req_itemname.toUpperCase().indexOf(row.req_itemcode.toUpperCase()) > -1) || (item.inputcode && item.inputcode.toUpperCase().indexOf(row.req_itemcode.toUpperCase()) > -1));
                tableDataList = list.slice(0, 50);
            } else {
                tableDataList = XEUtils.clone(this.fallReqsheetList.slice(0, 50), true);
            }
            this.$nextTick(() => {
                this.tableReqsheetList = tableDataList;
                if (tableDataList.length > 0) this.$refs.selectTable.setCurrentRow(tableDataList[0]);
            });
        },
        tableRowSelect(e) {
            var that = this;
            if (e) {
                setTimeout(() => {
                    if (that.$refs.selectTable) {
                        let bodyWrapper = that.$refs.selectTable.$el;
                        bodyWrapper.scrollTop = Math.floor(e.id / 7) * 210;
                    }
                }, 100);
            }
        },
        selectCurrChange({ row }) {
            this.selectReqChange(row);
        },
        selectTableRow(row) {
            if (!row) return false;
            this.$nextTick(() => {
                this.selectRow = row;
                this.$refs.selectTable.setCurrentRow(row);
                this.selectReqChange(row);
            });
        },
        selectReqChange(row) {
            if (row) {
                this.$refs.reqImport.slectReqItem(row);
            } else {
                this.addreqitemname = "";
            }
        },
        exportExcel() {
            let tableColumn = this.refsObj.getColumns();
            let extableColumn = [];
            tableColumn.forEach((item) => {
                extableColumn.push({ title: item.title, field: item.property });
            });
            let filtertxt = this.getExportFilter();
            this.$pub.exportTableExcel(this.master, extableColumn, "LIS251 申请录入.xlsx", filtertxt);
        },
        // 获取当前导出文件的所有查询条件
        getExportFilter() {
            let filtertxt = "创建日期:" + XEUtils.toDateString(this.searchObj.txtdatetime1, "yyyy-MM-dd") + "至" + XEUtils.toDateString(this.searchObj.txtdatetime2, "yyyy-MM-dd") + "; ";
            if(this.searchObj.txtbarcode) filtertxt += "条码号:" + this.searchObj.txtbarcode + "; ";
            if(this.searchObj.txtreqstat) filtertxt += "申请状态:" + this.txtreqstatname + "; ";
            if(this.searchObj.txtreqdeptno) filtertxt += "申请科室:" + this.txtreqdeptname + "; ";
            if(this.searchObj.txthospcode) filtertxt += "送检医院:" + this.txthospname + "; ";
            if(this.searchObj.approvalstate) filtertxt += "审核状态:" + this.getApprovalstatename() + "; ";
            if(this.searchObj.txtreqitem) filtertxt += "申请项目:" + this.txtreqitemname + "; ";
            if(this.searchObj.txtpatno) filtertxt += "病历号:" + this.searchObj.txtpatno + "; ";
            if(this.searchObj.txtpatname) filtertxt += "病人姓名:" + this.searchObj.txtpatname + "; ";
            if(this.searchObj.txtpatidcard) filtertxt += "病人身份证:" + this.searchObj.txtpatidcard + "; ";
            if(this.searchObj.txtpattype) filtertxt += "病人类型:" + this.txtpattypename + "; ";
            if(this.searchObj.txtcreateuser) filtertxt += "创建用户:" + this.txtcreateusername + "; ";
            return filtertxt;
        },
        getApprovalstatename() {
            let name = "";
            switch(this.searchObj.approvalstate)
            {
                case "all":
                    name = "全部";
                    break;
                case "0":
                    name = "未审核";
                    break;
                case "1":
                    name = "已审核";
                    break;
                case "2":
                    name = "未通过";
                    break;
            }
            return name;
        },
    },
    beforeRouteEnter(to, from, next) {
            next((vm) => {
                // 通过 `vm` 访问组件实例
                let that = vm;
                let arr = []; //组合按键 暂时支持alt吧 将来可以扩展
                document.onkeydown = function (e) {
                    let key = window.event.keyCode;
                    //console.log("key=", key);
                    if (arr.length > 0) {
                        //65到90 a到z（A到Z）
                        if (key == 67) {
                            //alert("复位");
                            //that.btnreset_click();
                        } else if (key == 66) {
                            // alert("单打条码");
                        } else if (key == 76) {
                            //alert("重打回单");
                        }
                    } else {
                        //112到135 F1到F24
                        if (key == 112) {
                            if(that.reqLocalseting.reqreadidcardseting=='1' && that.changeflag){
                                that.readcard(1);
                            }
                        }else if(key == 115){
                            if(that.reqLocalseting.reqreadidcardseting=='1'){
                                that.readcard(2);
                            }
                        }
                        else if(key == 117){
                            if (that.changeflag){
                                that.btnSave();
                            }
                        }
                    }
                };
                document.onkeyup = function (e) {
                    let key = window.event.keyCode;
                    if (key == 18) {
                        arr = [];
                    }
                };
            });
        },
};
</script>

<style scoped>
.pagetop {
    width: 100%;
    height: 70px;
    display: -webkit-box;
    -webkit-box-pack: left;
    -webkit-box-align: center;
    border: 1px solid #ccc;
    position: absolute;
    z-index: 99;
    overflow-x: auto;
    white-space: nowrap;
}
::-webkit-scrollbar {
    width: 0px;
    height: 5px;
    border: 4px solid white;
}
::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
}
::-webkit-scrollbar-track {
    background-color: #f1f1f1;
}
/* Buttons */
::-webkit-scrollbar-button:single-button {
    background-color: #bbbbbb;
    display: block;
    border-style: solid;
    height: 5px;
    width: 5px;
}
/* Left */
::-webkit-scrollbar-button:horizontal:decrement {
    margin-right: 2px;
    border-width: 4px 4px 4px 0;
    border-color: #f1f1f1 transparent #f1f1f1 #f1f1f1;
    background-color: #000000;
}
::-webkit-scrollbar-button:horizontal:decrement:hover {
    border-color: #d2d2d2 transparent #d2d2d2 #d2d2d2;
}
/* Right */
::-webkit-scrollbar-button:horizontal:increment {
    margin-left: 2px;
    border-width: 4px 0 4px 4px;
    border-color: #f1f1f1 #f1f1f1 #f1f1f1 transparent;
    background-color: #000000;
}
::-webkit-scrollbar-button:horizontal:increment:hover {
    border-color: #d2d2d2 #d2d2d2 #d2d2d2 transparent;
}

.pagecenter {
    position: absolute;
    top: 75px;
    width: 100%;
    left: 0;
    bottom: 0px;
    overflow: auto;
}
.pagetopother {
    width: 100%;
    height: 100px;
    display: -webkit-box;
    -webkit-box-pack: left;
    -webkit-box-align: center;
    border: 1px solid #ccc;
    position: absolute;
    z-index: 99;
}
.pagecenterother {
    position: absolute;
    top: 105px;
    width: 100%;
    left: 0;
    bottom: 0px;
    overflow: auto;
}
.middle-center {
    position: absolute;
    height: 100%;
    left: 0px;
    right: 585px;
    overflow: auto;
}

.middle-right {
    position: absolute;
    height: 100%;
    width: 580px;
    right: 0px;
}

.table1style tr td {
    padding: 1px 2px 1px 2px;
}

.table2style tr td {
    padding: 0px 5px 0px 3px;
}

.el-checkbox__label {
    display: inline-block;
    padding-left: 2px;
    line-height: 19px;
    font-size: 14px;
}
::v-deep .myclass > .table2style .el-input.is-disabled .el-input__inner {
    border-color: #e4e7ed;
    color: #c0c4cc;
    cursor: not-allowed;
}
::v-deep  .myclass .el-input--suffix .el-input__inner {
    padding-right: 10px;
}
::v-deep .myclass > .table2style .el-input--small .el-input__inner {
    height: 20px !important;
    line-height: 20px !important;
}
::v-deep  .myclass > .table2style .el-input--small .el-input__icon {
    line-height: 18px !important;
}
::v-deep  .el-input--prefix .el-input__inner {
    padding-left: 25px;
}
::v-deep  .el-button.is-disabled {
    border: 0px;
    color: grey;
    background-color: #e6e6e6;
    font-weight: normal;
}
::v-deep  .req-popcontent .el-tabs__content {
    position: relative !important;
    top: 0px !important;
}
.show-area {
    position: absolute;
    height: 100%;
    width: 100%;
    z-index: 1999;
    background: rgba(204, 204, 204, 0.2);
}
::v-deep  .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after {
    border-color: #000000;
}
.detail-operation {
    margin: 5px 0;
    text-align: right;
}
/* .req-select .hover {
    background-color: #d9dce0 !important;
}
.req-select .el-select-dropdown__item {
    font-size: 12px;
}
.req-el-option {
    display: inline-block;
} */
.req-select {
    display: inline-block;
    width: 180px;
    margin-right: 10px;
}
::v-deep  .req-select .el-select {
    width: 100%;
}
::v-deep  .table-bottom-content .vxe-table--empty-block {
    height: calc(100% - 32px);
}
.reqitem-dialog {
    position: absolute;
    z-index: 10000;
}
.reqitem-select {
    height: 250px;
}
::v-deep  .reqitem-select .vxe-table {
    border: 0 !important;
}
::v-deep  .reqitem-select .vxe-table .vxe-cell {
    padding: 0 5px;
}
::v-deep  .vxe-table--tooltip-wrapper.theme--dark {
    z-index: 10001 !important;
}
/* ::v-deep  .reqitem-select .el-table{
    height: 100%;
    overflow-y: auto;
}
::v-deep  .reqitem-select .el-table th {
    line-height: 23px !important;
}
::v-deep  .reqitem-select .vxe-table .cell {
    padding: 0 5px;
} */
::v-deep  .pagetop .el-input--suffix .el-input__inner {
    padding-right: 10px !important;
}
::v-deep  .pagetopother .el-input--suffix .el-input__inner {
    padding-right: 10px !important;
}
</style>
